nrf52840_pac/
pwm0.rs

1#[doc = r"Register block"]
2#[repr(C)]
3pub struct RegisterBlock {
4    _reserved0: [u8; 0x04],
5    #[doc = "0x04 - Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback"]
6    pub tasks_stop: TASKS_STOP,
7    #[doc = "0x08..0x10 - Description collection\\[n\\]: Loads the first PWM value on all enabled channels from sequence n, and starts playing that sequence at the rate defined in SEQ\\[n\\]REFRESH and/or DECODER.MODE. Causes PWM generation to start if not running."]
8    pub tasks_seqstart: [TASKS_SEQSTART; 2],
9    #[doc = "0x10 - Steps by one value in the current sequence on all enabled channels if DECODER.MODE=NextStep. Does not cause PWM generation to start if not running."]
10    pub tasks_nextstep: TASKS_NEXTSTEP,
11    _reserved3: [u8; 0xf0],
12    #[doc = "0x104 - Response to STOP task, emitted when PWM pulses are no longer generated"]
13    pub events_stopped: EVENTS_STOPPED,
14    #[doc = "0x108..0x110 - Description collection\\[n\\]: First PWM period started on sequence n"]
15    pub events_seqstarted: [EVENTS_SEQSTARTED; 2],
16    #[doc = "0x110..0x118 - Description collection\\[n\\]: Emitted at end of every sequence n, when last value from RAM has been applied to wave counter"]
17    pub events_seqend: [EVENTS_SEQEND; 2],
18    #[doc = "0x118 - Emitted at the end of each PWM period"]
19    pub events_pwmperiodend: EVENTS_PWMPERIODEND,
20    #[doc = "0x11c - Concatenated sequences have been played the amount of times defined in LOOP.CNT"]
21    pub events_loopsdone: EVENTS_LOOPSDONE,
22    _reserved8: [u8; 0xe0],
23    #[doc = "0x200 - Shortcut register"]
24    pub shorts: SHORTS,
25    _reserved9: [u8; 0xfc],
26    #[doc = "0x300 - Enable or disable interrupt"]
27    pub inten: INTEN,
28    #[doc = "0x304 - Enable interrupt"]
29    pub intenset: INTENSET,
30    #[doc = "0x308 - Disable interrupt"]
31    pub intenclr: INTENCLR,
32    _reserved12: [u8; 0x01f4],
33    #[doc = "0x500 - PWM module enable register"]
34    pub enable: ENABLE,
35    #[doc = "0x504 - Selects operating mode of the wave counter"]
36    pub mode: MODE,
37    #[doc = "0x508 - Value up to which the pulse generator counter counts"]
38    pub countertop: COUNTERTOP,
39    #[doc = "0x50c - Configuration for PWM_CLK"]
40    pub prescaler: PRESCALER,
41    #[doc = "0x510 - Configuration of the decoder"]
42    pub decoder: DECODER,
43    #[doc = "0x514 - Number of playbacks of a loop"]
44    pub loop_: LOOP,
45    _reserved18: [u8; 0x08],
46    #[doc = "0x520..0x530 - Unspecified"]
47    pub seq0: SEQ,
48    _reserved19: [u8; 0x10],
49    #[doc = "0x540..0x550 - Unspecified"]
50    pub seq1: SEQ,
51    _reserved20: [u8; 0x10],
52    #[doc = "0x560..0x570 - Unspecified"]
53    pub psel: PSEL,
54}
55#[doc = "TASKS_STOP (w) register accessor: an alias for `Reg<TASKS_STOP_SPEC>`"]
56pub type TASKS_STOP = crate::Reg<tasks_stop::TASKS_STOP_SPEC>;
57#[doc = "Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback"]
58pub mod tasks_stop;
59#[doc = "TASKS_SEQSTART (w) register accessor: an alias for `Reg<TASKS_SEQSTART_SPEC>`"]
60pub type TASKS_SEQSTART = crate::Reg<tasks_seqstart::TASKS_SEQSTART_SPEC>;
61#[doc = "Description collection\\[n\\]: Loads the first PWM value on all enabled channels from sequence n, and starts playing that sequence at the rate defined in SEQ\\[n\\]REFRESH and/or DECODER.MODE. Causes PWM generation to start if not running."]
62pub mod tasks_seqstart;
63#[doc = "TASKS_NEXTSTEP (w) register accessor: an alias for `Reg<TASKS_NEXTSTEP_SPEC>`"]
64pub type TASKS_NEXTSTEP = crate::Reg<tasks_nextstep::TASKS_NEXTSTEP_SPEC>;
65#[doc = "Steps by one value in the current sequence on all enabled channels if DECODER.MODE=NextStep. Does not cause PWM generation to start if not running."]
66pub mod tasks_nextstep;
67#[doc = "EVENTS_STOPPED (rw) register accessor: an alias for `Reg<EVENTS_STOPPED_SPEC>`"]
68pub type EVENTS_STOPPED = crate::Reg<events_stopped::EVENTS_STOPPED_SPEC>;
69#[doc = "Response to STOP task, emitted when PWM pulses are no longer generated"]
70pub mod events_stopped;
71#[doc = "EVENTS_SEQSTARTED (rw) register accessor: an alias for `Reg<EVENTS_SEQSTARTED_SPEC>`"]
72pub type EVENTS_SEQSTARTED = crate::Reg<events_seqstarted::EVENTS_SEQSTARTED_SPEC>;
73#[doc = "Description collection\\[n\\]: First PWM period started on sequence n"]
74pub mod events_seqstarted;
75#[doc = "EVENTS_SEQEND (rw) register accessor: an alias for `Reg<EVENTS_SEQEND_SPEC>`"]
76pub type EVENTS_SEQEND = crate::Reg<events_seqend::EVENTS_SEQEND_SPEC>;
77#[doc = "Description collection\\[n\\]: Emitted at end of every sequence n, when last value from RAM has been applied to wave counter"]
78pub mod events_seqend;
79#[doc = "EVENTS_PWMPERIODEND (rw) register accessor: an alias for `Reg<EVENTS_PWMPERIODEND_SPEC>`"]
80pub type EVENTS_PWMPERIODEND = crate::Reg<events_pwmperiodend::EVENTS_PWMPERIODEND_SPEC>;
81#[doc = "Emitted at the end of each PWM period"]
82pub mod events_pwmperiodend;
83#[doc = "EVENTS_LOOPSDONE (rw) register accessor: an alias for `Reg<EVENTS_LOOPSDONE_SPEC>`"]
84pub type EVENTS_LOOPSDONE = crate::Reg<events_loopsdone::EVENTS_LOOPSDONE_SPEC>;
85#[doc = "Concatenated sequences have been played the amount of times defined in LOOP.CNT"]
86pub mod events_loopsdone;
87#[doc = "SHORTS (rw) register accessor: an alias for `Reg<SHORTS_SPEC>`"]
88pub type SHORTS = crate::Reg<shorts::SHORTS_SPEC>;
89#[doc = "Shortcut register"]
90pub mod shorts;
91#[doc = "INTEN (rw) register accessor: an alias for `Reg<INTEN_SPEC>`"]
92pub type INTEN = crate::Reg<inten::INTEN_SPEC>;
93#[doc = "Enable or disable interrupt"]
94pub mod inten;
95#[doc = "INTENSET (rw) register accessor: an alias for `Reg<INTENSET_SPEC>`"]
96pub type INTENSET = crate::Reg<intenset::INTENSET_SPEC>;
97#[doc = "Enable interrupt"]
98pub mod intenset;
99#[doc = "INTENCLR (rw) register accessor: an alias for `Reg<INTENCLR_SPEC>`"]
100pub type INTENCLR = crate::Reg<intenclr::INTENCLR_SPEC>;
101#[doc = "Disable interrupt"]
102pub mod intenclr;
103#[doc = "ENABLE (rw) register accessor: an alias for `Reg<ENABLE_SPEC>`"]
104pub type ENABLE = crate::Reg<enable::ENABLE_SPEC>;
105#[doc = "PWM module enable register"]
106pub mod enable;
107#[doc = "MODE (rw) register accessor: an alias for `Reg<MODE_SPEC>`"]
108pub type MODE = crate::Reg<mode::MODE_SPEC>;
109#[doc = "Selects operating mode of the wave counter"]
110pub mod mode;
111#[doc = "COUNTERTOP (rw) register accessor: an alias for `Reg<COUNTERTOP_SPEC>`"]
112pub type COUNTERTOP = crate::Reg<countertop::COUNTERTOP_SPEC>;
113#[doc = "Value up to which the pulse generator counter counts"]
114pub mod countertop;
115#[doc = "PRESCALER (rw) register accessor: an alias for `Reg<PRESCALER_SPEC>`"]
116pub type PRESCALER = crate::Reg<prescaler::PRESCALER_SPEC>;
117#[doc = "Configuration for PWM_CLK"]
118pub mod prescaler;
119#[doc = "DECODER (rw) register accessor: an alias for `Reg<DECODER_SPEC>`"]
120pub type DECODER = crate::Reg<decoder::DECODER_SPEC>;
121#[doc = "Configuration of the decoder"]
122pub mod decoder;
123#[doc = "LOOP (rw) register accessor: an alias for `Reg<LOOP_SPEC>`"]
124pub type LOOP = crate::Reg<loop_::LOOP_SPEC>;
125#[doc = "Number of playbacks of a loop"]
126pub mod loop_;
127#[doc = "Unspecified"]
128pub use seq::SEQ;
129#[doc = r"Cluster"]
130#[doc = "Unspecified"]
131pub mod seq;
132#[doc = "Unspecified"]
133pub use psel::PSEL;
134#[doc = r"Cluster"]
135#[doc = "Unspecified"]
136pub mod psel;