Robobo
component_pwm.h
1 /* ----------------------------------------------------------------------------
2  * SAM Software Package License
3  * ----------------------------------------------------------------------------
4  * Copyright (c) 2012, Atmel Corporation
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following condition is met:
10  *
11  * - Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the disclaimer below.
13  *
14  * Atmel's name may not be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * ----------------------------------------------------------------------------
28  */
29 
30 #ifndef _SAM3S_PWM_COMPONENT_
31 #define _SAM3S_PWM_COMPONENT_
32 
33 /* ============================================================================= */
35 /* ============================================================================= */
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 
41 typedef struct {
42  RwReg PWM_CMR;
43  RwReg PWM_CDTY;
45  RwReg PWM_CPRD;
47  RwReg PWM_CCNT;
50 } PwmCh_num;
52 typedef struct {
57 } PwmCmp;
59 #define PWMCMP_NUMBER 8
60 #define PWMCH_NUM_NUMBER 4
61 typedef struct {
63  WoReg PWM_ENA;
64  WoReg PWM_DIS;
65  RoReg PWM_SR;
71  RoReg Reserved1[1];
90  RoReg Reserved2[3];
91  RwReg PWM_ELMR[2];
92  RoReg Reserved3[11];
94  RoReg Reserved4[12];
97  RoReg Reserved5[7];
100  RoReg Reserved6[2];
105  RoReg Reserved7[2];
107  RoReg Reserved8[20];
108  PwmCh_num PWM_CH_NUM[PWMCH_NUM_NUMBER];
109 } Pwm;
110 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
111 /* -------- PWM_CLK : (PWM Offset: 0x00) PWM Clock Register -------- */
112 #define PWM_CLK_DIVA_Pos 0
113 #define PWM_CLK_DIVA_Msk (0xffu << PWM_CLK_DIVA_Pos)
114 #define PWM_CLK_DIVA(value) ((PWM_CLK_DIVA_Msk & ((value) << PWM_CLK_DIVA_Pos)))
115 #define PWM_CLK_PREA_Pos 8
116 #define PWM_CLK_PREA_Msk (0xfu << PWM_CLK_PREA_Pos)
117 #define PWM_CLK_PREA(value) ((PWM_CLK_PREA_Msk & ((value) << PWM_CLK_PREA_Pos)))
118 #define PWM_CLK_DIVB_Pos 16
119 #define PWM_CLK_DIVB_Msk (0xffu << PWM_CLK_DIVB_Pos)
120 #define PWM_CLK_DIVB(value) ((PWM_CLK_DIVB_Msk & ((value) << PWM_CLK_DIVB_Pos)))
121 #define PWM_CLK_PREB_Pos 24
122 #define PWM_CLK_PREB_Msk (0xfu << PWM_CLK_PREB_Pos)
123 #define PWM_CLK_PREB(value) ((PWM_CLK_PREB_Msk & ((value) << PWM_CLK_PREB_Pos)))
124 /* -------- PWM_ENA : (PWM Offset: 0x04) PWM Enable Register -------- */
125 #define PWM_ENA_CHID0 (0x1u << 0)
126 #define PWM_ENA_CHID1 (0x1u << 1)
127 #define PWM_ENA_CHID2 (0x1u << 2)
128 #define PWM_ENA_CHID3 (0x1u << 3)
129 /* -------- PWM_DIS : (PWM Offset: 0x08) PWM Disable Register -------- */
130 #define PWM_DIS_CHID0 (0x1u << 0)
131 #define PWM_DIS_CHID1 (0x1u << 1)
132 #define PWM_DIS_CHID2 (0x1u << 2)
133 #define PWM_DIS_CHID3 (0x1u << 3)
134 /* -------- PWM_SR : (PWM Offset: 0x0C) PWM Status Register -------- */
135 #define PWM_SR_CHID0 (0x1u << 0)
136 #define PWM_SR_CHID1 (0x1u << 1)
137 #define PWM_SR_CHID2 (0x1u << 2)
138 #define PWM_SR_CHID3 (0x1u << 3)
139 /* -------- PWM_IER1 : (PWM Offset: 0x10) PWM Interrupt Enable Register 1 -------- */
140 #define PWM_IER1_CHID0 (0x1u << 0)
141 #define PWM_IER1_CHID1 (0x1u << 1)
142 #define PWM_IER1_CHID2 (0x1u << 2)
143 #define PWM_IER1_CHID3 (0x1u << 3)
144 #define PWM_IER1_FCHID0 (0x1u << 16)
145 #define PWM_IER1_FCHID1 (0x1u << 17)
146 #define PWM_IER1_FCHID2 (0x1u << 18)
147 #define PWM_IER1_FCHID3 (0x1u << 19)
148 /* -------- PWM_IDR1 : (PWM Offset: 0x14) PWM Interrupt Disable Register 1 -------- */
149 #define PWM_IDR1_CHID0 (0x1u << 0)
150 #define PWM_IDR1_CHID1 (0x1u << 1)
151 #define PWM_IDR1_CHID2 (0x1u << 2)
152 #define PWM_IDR1_CHID3 (0x1u << 3)
153 #define PWM_IDR1_FCHID0 (0x1u << 16)
154 #define PWM_IDR1_FCHID1 (0x1u << 17)
155 #define PWM_IDR1_FCHID2 (0x1u << 18)
156 #define PWM_IDR1_FCHID3 (0x1u << 19)
157 /* -------- PWM_IMR1 : (PWM Offset: 0x18) PWM Interrupt Mask Register 1 -------- */
158 #define PWM_IMR1_CHID0 (0x1u << 0)
159 #define PWM_IMR1_CHID1 (0x1u << 1)
160 #define PWM_IMR1_CHID2 (0x1u << 2)
161 #define PWM_IMR1_CHID3 (0x1u << 3)
162 #define PWM_IMR1_FCHID0 (0x1u << 16)
163 #define PWM_IMR1_FCHID1 (0x1u << 17)
164 #define PWM_IMR1_FCHID2 (0x1u << 18)
165 #define PWM_IMR1_FCHID3 (0x1u << 19)
166 /* -------- PWM_ISR1 : (PWM Offset: 0x1C) PWM Interrupt Status Register 1 -------- */
167 #define PWM_ISR1_CHID0 (0x1u << 0)
168 #define PWM_ISR1_CHID1 (0x1u << 1)
169 #define PWM_ISR1_CHID2 (0x1u << 2)
170 #define PWM_ISR1_CHID3 (0x1u << 3)
171 #define PWM_ISR1_FCHID0 (0x1u << 16)
172 #define PWM_ISR1_FCHID1 (0x1u << 17)
173 #define PWM_ISR1_FCHID2 (0x1u << 18)
174 #define PWM_ISR1_FCHID3 (0x1u << 19)
175 /* -------- PWM_SCM : (PWM Offset: 0x20) PWM Sync Channels Mode Register -------- */
176 #define PWM_SCM_SYNC0 (0x1u << 0)
177 #define PWM_SCM_SYNC1 (0x1u << 1)
178 #define PWM_SCM_SYNC2 (0x1u << 2)
179 #define PWM_SCM_SYNC3 (0x1u << 3)
180 #define PWM_SCM_UPDM_Pos 16
181 #define PWM_SCM_UPDM_Msk (0x3u << PWM_SCM_UPDM_Pos)
182 #define PWM_SCM_UPDM_MODE0 (0x0u << 16)
183 #define PWM_SCM_UPDM_MODE1 (0x1u << 16)
184 #define PWM_SCM_UPDM_MODE2 (0x2u << 16)
185 #define PWM_SCM_PTRM (0x1u << 20)
186 #define PWM_SCM_PTRCS_Pos 21
187 #define PWM_SCM_PTRCS_Msk (0x7u << PWM_SCM_PTRCS_Pos)
188 #define PWM_SCM_PTRCS(value) ((PWM_SCM_PTRCS_Msk & ((value) << PWM_SCM_PTRCS_Pos)))
189 /* -------- PWM_SCUC : (PWM Offset: 0x28) PWM Sync Channels Update Control Register -------- */
190 #define PWM_SCUC_UPDULOCK (0x1u << 0)
191 /* -------- PWM_SCUP : (PWM Offset: 0x2C) PWM Sync Channels Update Period Register -------- */
192 #define PWM_SCUP_UPR_Pos 0
193 #define PWM_SCUP_UPR_Msk (0xfu << PWM_SCUP_UPR_Pos)
194 #define PWM_SCUP_UPR(value) ((PWM_SCUP_UPR_Msk & ((value) << PWM_SCUP_UPR_Pos)))
195 #define PWM_SCUP_UPRCNT_Pos 4
196 #define PWM_SCUP_UPRCNT_Msk (0xfu << PWM_SCUP_UPRCNT_Pos)
197 #define PWM_SCUP_UPRCNT(value) ((PWM_SCUP_UPRCNT_Msk & ((value) << PWM_SCUP_UPRCNT_Pos)))
198 /* -------- PWM_SCUPUPD : (PWM Offset: 0x30) PWM Sync Channels Update Period Update Register -------- */
199 #define PWM_SCUPUPD_UPRUPD_Pos 0
200 #define PWM_SCUPUPD_UPRUPD_Msk (0xfu << PWM_SCUPUPD_UPRUPD_Pos)
201 #define PWM_SCUPUPD_UPRUPD(value) ((PWM_SCUPUPD_UPRUPD_Msk & ((value) << PWM_SCUPUPD_UPRUPD_Pos)))
202 /* -------- PWM_IER2 : (PWM Offset: 0x34) PWM Interrupt Enable Register 2 -------- */
203 #define PWM_IER2_WRDY (0x1u << 0)
204 #define PWM_IER2_ENDTX (0x1u << 1)
205 #define PWM_IER2_TXBUFE (0x1u << 2)
206 #define PWM_IER2_UNRE (0x1u << 3)
207 #define PWM_IER2_CMPM0 (0x1u << 8)
208 #define PWM_IER2_CMPM1 (0x1u << 9)
209 #define PWM_IER2_CMPM2 (0x1u << 10)
210 #define PWM_IER2_CMPM3 (0x1u << 11)
211 #define PWM_IER2_CMPM4 (0x1u << 12)
212 #define PWM_IER2_CMPM5 (0x1u << 13)
213 #define PWM_IER2_CMPM6 (0x1u << 14)
214 #define PWM_IER2_CMPM7 (0x1u << 15)
215 #define PWM_IER2_CMPU0 (0x1u << 16)
216 #define PWM_IER2_CMPU1 (0x1u << 17)
217 #define PWM_IER2_CMPU2 (0x1u << 18)
218 #define PWM_IER2_CMPU3 (0x1u << 19)
219 #define PWM_IER2_CMPU4 (0x1u << 20)
220 #define PWM_IER2_CMPU5 (0x1u << 21)
221 #define PWM_IER2_CMPU6 (0x1u << 22)
222 #define PWM_IER2_CMPU7 (0x1u << 23)
223 /* -------- PWM_IDR2 : (PWM Offset: 0x38) PWM Interrupt Disable Register 2 -------- */
224 #define PWM_IDR2_WRDY (0x1u << 0)
225 #define PWM_IDR2_ENDTX (0x1u << 1)
226 #define PWM_IDR2_TXBUFE (0x1u << 2)
227 #define PWM_IDR2_UNRE (0x1u << 3)
228 #define PWM_IDR2_CMPM0 (0x1u << 8)
229 #define PWM_IDR2_CMPM1 (0x1u << 9)
230 #define PWM_IDR2_CMPM2 (0x1u << 10)
231 #define PWM_IDR2_CMPM3 (0x1u << 11)
232 #define PWM_IDR2_CMPM4 (0x1u << 12)
233 #define PWM_IDR2_CMPM5 (0x1u << 13)
234 #define PWM_IDR2_CMPM6 (0x1u << 14)
235 #define PWM_IDR2_CMPM7 (0x1u << 15)
236 #define PWM_IDR2_CMPU0 (0x1u << 16)
237 #define PWM_IDR2_CMPU1 (0x1u << 17)
238 #define PWM_IDR2_CMPU2 (0x1u << 18)
239 #define PWM_IDR2_CMPU3 (0x1u << 19)
240 #define PWM_IDR2_CMPU4 (0x1u << 20)
241 #define PWM_IDR2_CMPU5 (0x1u << 21)
242 #define PWM_IDR2_CMPU6 (0x1u << 22)
243 #define PWM_IDR2_CMPU7 (0x1u << 23)
244 /* -------- PWM_IMR2 : (PWM Offset: 0x3C) PWM Interrupt Mask Register 2 -------- */
245 #define PWM_IMR2_WRDY (0x1u << 0)
246 #define PWM_IMR2_ENDTX (0x1u << 1)
247 #define PWM_IMR2_TXBUFE (0x1u << 2)
248 #define PWM_IMR2_UNRE (0x1u << 3)
249 #define PWM_IMR2_CMPM0 (0x1u << 8)
250 #define PWM_IMR2_CMPM1 (0x1u << 9)
251 #define PWM_IMR2_CMPM2 (0x1u << 10)
252 #define PWM_IMR2_CMPM3 (0x1u << 11)
253 #define PWM_IMR2_CMPM4 (0x1u << 12)
254 #define PWM_IMR2_CMPM5 (0x1u << 13)
255 #define PWM_IMR2_CMPM6 (0x1u << 14)
256 #define PWM_IMR2_CMPM7 (0x1u << 15)
257 #define PWM_IMR2_CMPU0 (0x1u << 16)
258 #define PWM_IMR2_CMPU1 (0x1u << 17)
259 #define PWM_IMR2_CMPU2 (0x1u << 18)
260 #define PWM_IMR2_CMPU3 (0x1u << 19)
261 #define PWM_IMR2_CMPU4 (0x1u << 20)
262 #define PWM_IMR2_CMPU5 (0x1u << 21)
263 #define PWM_IMR2_CMPU6 (0x1u << 22)
264 #define PWM_IMR2_CMPU7 (0x1u << 23)
265 /* -------- PWM_ISR2 : (PWM Offset: 0x40) PWM Interrupt Status Register 2 -------- */
266 #define PWM_ISR2_WRDY (0x1u << 0)
267 #define PWM_ISR2_ENDTX (0x1u << 1)
268 #define PWM_ISR2_TXBUFE (0x1u << 2)
269 #define PWM_ISR2_UNRE (0x1u << 3)
270 #define PWM_ISR2_CMPM0 (0x1u << 8)
271 #define PWM_ISR2_CMPM1 (0x1u << 9)
272 #define PWM_ISR2_CMPM2 (0x1u << 10)
273 #define PWM_ISR2_CMPM3 (0x1u << 11)
274 #define PWM_ISR2_CMPM4 (0x1u << 12)
275 #define PWM_ISR2_CMPM5 (0x1u << 13)
276 #define PWM_ISR2_CMPM6 (0x1u << 14)
277 #define PWM_ISR2_CMPM7 (0x1u << 15)
278 #define PWM_ISR2_CMPU0 (0x1u << 16)
279 #define PWM_ISR2_CMPU1 (0x1u << 17)
280 #define PWM_ISR2_CMPU2 (0x1u << 18)
281 #define PWM_ISR2_CMPU3 (0x1u << 19)
282 #define PWM_ISR2_CMPU4 (0x1u << 20)
283 #define PWM_ISR2_CMPU5 (0x1u << 21)
284 #define PWM_ISR2_CMPU6 (0x1u << 22)
285 #define PWM_ISR2_CMPU7 (0x1u << 23)
286 /* -------- PWM_OOV : (PWM Offset: 0x44) PWM Output Override Value Register -------- */
287 #define PWM_OOV_OOVH0 (0x1u << 0)
288 #define PWM_OOV_OOVH1 (0x1u << 1)
289 #define PWM_OOV_OOVH2 (0x1u << 2)
290 #define PWM_OOV_OOVH3 (0x1u << 3)
291 #define PWM_OOV_OOVL0 (0x1u << 16)
292 #define PWM_OOV_OOVL1 (0x1u << 17)
293 #define PWM_OOV_OOVL2 (0x1u << 18)
294 #define PWM_OOV_OOVL3 (0x1u << 19)
295 /* -------- PWM_OS : (PWM Offset: 0x48) PWM Output Selection Register -------- */
296 #define PWM_OS_OSH0 (0x1u << 0)
297 #define PWM_OS_OSH1 (0x1u << 1)
298 #define PWM_OS_OSH2 (0x1u << 2)
299 #define PWM_OS_OSH3 (0x1u << 3)
300 #define PWM_OS_OSL0 (0x1u << 16)
301 #define PWM_OS_OSL1 (0x1u << 17)
302 #define PWM_OS_OSL2 (0x1u << 18)
303 #define PWM_OS_OSL3 (0x1u << 19)
304 /* -------- PWM_OSS : (PWM Offset: 0x4C) PWM Output Selection Set Register -------- */
305 #define PWM_OSS_OSSH0 (0x1u << 0)
306 #define PWM_OSS_OSSH1 (0x1u << 1)
307 #define PWM_OSS_OSSH2 (0x1u << 2)
308 #define PWM_OSS_OSSH3 (0x1u << 3)
309 #define PWM_OSS_OSSL0 (0x1u << 16)
310 #define PWM_OSS_OSSL1 (0x1u << 17)
311 #define PWM_OSS_OSSL2 (0x1u << 18)
312 #define PWM_OSS_OSSL3 (0x1u << 19)
313 /* -------- PWM_OSC : (PWM Offset: 0x50) PWM Output Selection Clear Register -------- */
314 #define PWM_OSC_OSCH0 (0x1u << 0)
315 #define PWM_OSC_OSCH1 (0x1u << 1)
316 #define PWM_OSC_OSCH2 (0x1u << 2)
317 #define PWM_OSC_OSCH3 (0x1u << 3)
318 #define PWM_OSC_OSCL0 (0x1u << 16)
319 #define PWM_OSC_OSCL1 (0x1u << 17)
320 #define PWM_OSC_OSCL2 (0x1u << 18)
321 #define PWM_OSC_OSCL3 (0x1u << 19)
322 /* -------- PWM_OSSUPD : (PWM Offset: 0x54) PWM Output Selection Set Update Register -------- */
323 #define PWM_OSSUPD_OSSUPH0 (0x1u << 0)
324 #define PWM_OSSUPD_OSSUPH1 (0x1u << 1)
325 #define PWM_OSSUPD_OSSUPH2 (0x1u << 2)
326 #define PWM_OSSUPD_OSSUPH3 (0x1u << 3)
327 #define PWM_OSSUPD_OSSUPL0 (0x1u << 16)
328 #define PWM_OSSUPD_OSSUPL1 (0x1u << 17)
329 #define PWM_OSSUPD_OSSUPL2 (0x1u << 18)
330 #define PWM_OSSUPD_OSSUPL3 (0x1u << 19)
331 /* -------- PWM_OSCUPD : (PWM Offset: 0x58) PWM Output Selection Clear Update Register -------- */
332 #define PWM_OSCUPD_OSCUPH0 (0x1u << 0)
333 #define PWM_OSCUPD_OSCUPH1 (0x1u << 1)
334 #define PWM_OSCUPD_OSCUPH2 (0x1u << 2)
335 #define PWM_OSCUPD_OSCUPH3 (0x1u << 3)
336 #define PWM_OSCUPD_OSCUPL0 (0x1u << 16)
337 #define PWM_OSCUPD_OSCUPL1 (0x1u << 17)
338 #define PWM_OSCUPD_OSCUPL2 (0x1u << 18)
339 #define PWM_OSCUPD_OSCUPL3 (0x1u << 19)
340 /* -------- PWM_FMR : (PWM Offset: 0x5C) PWM Fault Mode Register -------- */
341 #define PWM_FMR_FPOL_Pos 0
342 #define PWM_FMR_FPOL_Msk (0xffu << PWM_FMR_FPOL_Pos)
343 #define PWM_FMR_FPOL(value) ((PWM_FMR_FPOL_Msk & ((value) << PWM_FMR_FPOL_Pos)))
344 #define PWM_FMR_FMOD_Pos 8
345 #define PWM_FMR_FMOD_Msk (0xffu << PWM_FMR_FMOD_Pos)
346 #define PWM_FMR_FMOD(value) ((PWM_FMR_FMOD_Msk & ((value) << PWM_FMR_FMOD_Pos)))
347 #define PWM_FMR_FFIL_Pos 16
348 #define PWM_FMR_FFIL_Msk (0xffu << PWM_FMR_FFIL_Pos)
349 #define PWM_FMR_FFIL(value) ((PWM_FMR_FFIL_Msk & ((value) << PWM_FMR_FFIL_Pos)))
350 /* -------- PWM_FSR : (PWM Offset: 0x60) PWM Fault Status Register -------- */
351 #define PWM_FSR_FIV_Pos 0
352 #define PWM_FSR_FIV_Msk (0xffu << PWM_FSR_FIV_Pos)
353 #define PWM_FSR_FS_Pos 8
354 #define PWM_FSR_FS_Msk (0xffu << PWM_FSR_FS_Pos)
355 /* -------- PWM_FCR : (PWM Offset: 0x64) PWM Fault Clear Register -------- */
356 #define PWM_FCR_FCLR_Pos 0
357 #define PWM_FCR_FCLR_Msk (0xffu << PWM_FCR_FCLR_Pos)
358 #define PWM_FCR_FCLR(value) ((PWM_FCR_FCLR_Msk & ((value) << PWM_FCR_FCLR_Pos)))
359 /* -------- PWM_FPV : (PWM Offset: 0x68) PWM Fault Protection Value Register -------- */
360 #define PWM_FPV_FPVH0 (0x1u << 0)
361 #define PWM_FPV_FPVH1 (0x1u << 1)
362 #define PWM_FPV_FPVH2 (0x1u << 2)
363 #define PWM_FPV_FPVH3 (0x1u << 3)
364 #define PWM_FPV_FPVL0 (0x1u << 16)
365 #define PWM_FPV_FPVL1 (0x1u << 17)
366 #define PWM_FPV_FPVL2 (0x1u << 18)
367 #define PWM_FPV_FPVL3 (0x1u << 19)
368 /* -------- PWM_FPE : (PWM Offset: 0x6C) PWM Fault Protection Enable Register -------- */
369 #define PWM_FPE_FPE0_Pos 0
370 #define PWM_FPE_FPE0_Msk (0xffu << PWM_FPE_FPE0_Pos)
371 #define PWM_FPE_FPE0(value) ((PWM_FPE_FPE0_Msk & ((value) << PWM_FPE_FPE0_Pos)))
372 #define PWM_FPE_FPE1_Pos 8
373 #define PWM_FPE_FPE1_Msk (0xffu << PWM_FPE_FPE1_Pos)
374 #define PWM_FPE_FPE1(value) ((PWM_FPE_FPE1_Msk & ((value) << PWM_FPE_FPE1_Pos)))
375 #define PWM_FPE_FPE2_Pos 16
376 #define PWM_FPE_FPE2_Msk (0xffu << PWM_FPE_FPE2_Pos)
377 #define PWM_FPE_FPE2(value) ((PWM_FPE_FPE2_Msk & ((value) << PWM_FPE_FPE2_Pos)))
378 #define PWM_FPE_FPE3_Pos 24
379 #define PWM_FPE_FPE3_Msk (0xffu << PWM_FPE_FPE3_Pos)
380 #define PWM_FPE_FPE3(value) ((PWM_FPE_FPE3_Msk & ((value) << PWM_FPE_FPE3_Pos)))
381 /* -------- PWM_ELMR[2] : (PWM Offset: 0x7C) PWM Event Line 0 Mode Register -------- */
382 #define PWM_ELMR_CSEL0 (0x1u << 0)
383 #define PWM_ELMR_CSEL1 (0x1u << 1)
384 #define PWM_ELMR_CSEL2 (0x1u << 2)
385 #define PWM_ELMR_CSEL3 (0x1u << 3)
386 #define PWM_ELMR_CSEL4 (0x1u << 4)
387 #define PWM_ELMR_CSEL5 (0x1u << 5)
388 #define PWM_ELMR_CSEL6 (0x1u << 6)
389 #define PWM_ELMR_CSEL7 (0x1u << 7)
390 /* -------- PWM_SMMR : (PWM Offset: 0xB0) PWM Stepper Motor Mode Register -------- */
391 #define PWM_SMMR_GCEN0 (0x1u << 0)
392 #define PWM_SMMR_GCEN1 (0x1u << 1)
393 #define PWM_SMMR_DOWN0 (0x1u << 16)
394 #define PWM_SMMR_DOWN1 (0x1u << 17)
395 /* -------- PWM_WPCR : (PWM Offset: 0xE4) PWM Write Protect Control Register -------- */
396 #define PWM_WPCR_WPCMD_Pos 0
397 #define PWM_WPCR_WPCMD_Msk (0x3u << PWM_WPCR_WPCMD_Pos)
398 #define PWM_WPCR_WPCMD(value) ((PWM_WPCR_WPCMD_Msk & ((value) << PWM_WPCR_WPCMD_Pos)))
399 #define PWM_WPCR_WPRG0 (0x1u << 2)
400 #define PWM_WPCR_WPRG1 (0x1u << 3)
401 #define PWM_WPCR_WPRG2 (0x1u << 4)
402 #define PWM_WPCR_WPRG3 (0x1u << 5)
403 #define PWM_WPCR_WPRG4 (0x1u << 6)
404 #define PWM_WPCR_WPRG5 (0x1u << 7)
405 #define PWM_WPCR_WPKEY_Pos 8
406 #define PWM_WPCR_WPKEY_Msk (0xffffffu << PWM_WPCR_WPKEY_Pos)
407 #define PWM_WPCR_WPKEY(value) ((PWM_WPCR_WPKEY_Msk & ((value) << PWM_WPCR_WPKEY_Pos)))
408 /* -------- PWM_WPSR : (PWM Offset: 0xE8) PWM Write Protect Status Register -------- */
409 #define PWM_WPSR_WPSWS0 (0x1u << 0)
410 #define PWM_WPSR_WPSWS1 (0x1u << 1)
411 #define PWM_WPSR_WPSWS2 (0x1u << 2)
412 #define PWM_WPSR_WPSWS3 (0x1u << 3)
413 #define PWM_WPSR_WPSWS4 (0x1u << 4)
414 #define PWM_WPSR_WPSWS5 (0x1u << 5)
415 #define PWM_WPSR_WPVS (0x1u << 7)
416 #define PWM_WPSR_WPHWS0 (0x1u << 8)
417 #define PWM_WPSR_WPHWS1 (0x1u << 9)
418 #define PWM_WPSR_WPHWS2 (0x1u << 10)
419 #define PWM_WPSR_WPHWS3 (0x1u << 11)
420 #define PWM_WPSR_WPHWS4 (0x1u << 12)
421 #define PWM_WPSR_WPHWS5 (0x1u << 13)
422 #define PWM_WPSR_WPVSRC_Pos 16
423 #define PWM_WPSR_WPVSRC_Msk (0xffffu << PWM_WPSR_WPVSRC_Pos)
424 /* -------- PWM_TPR : (PWM Offset: 0x108) Transmit Pointer Register -------- */
425 #define PWM_TPR_TXPTR_Pos 0
426 #define PWM_TPR_TXPTR_Msk (0xffffffffu << PWM_TPR_TXPTR_Pos)
427 #define PWM_TPR_TXPTR(value) ((PWM_TPR_TXPTR_Msk & ((value) << PWM_TPR_TXPTR_Pos)))
428 /* -------- PWM_TCR : (PWM Offset: 0x10C) Transmit Counter Register -------- */
429 #define PWM_TCR_TXCTR_Pos 0
430 #define PWM_TCR_TXCTR_Msk (0xffffu << PWM_TCR_TXCTR_Pos)
431 #define PWM_TCR_TXCTR(value) ((PWM_TCR_TXCTR_Msk & ((value) << PWM_TCR_TXCTR_Pos)))
432 /* -------- PWM_TNPR : (PWM Offset: 0x118) Transmit Next Pointer Register -------- */
433 #define PWM_TNPR_TXNPTR_Pos 0
434 #define PWM_TNPR_TXNPTR_Msk (0xffffffffu << PWM_TNPR_TXNPTR_Pos)
435 #define PWM_TNPR_TXNPTR(value) ((PWM_TNPR_TXNPTR_Msk & ((value) << PWM_TNPR_TXNPTR_Pos)))
436 /* -------- PWM_TNCR : (PWM Offset: 0x11C) Transmit Next Counter Register -------- */
437 #define PWM_TNCR_TXNCTR_Pos 0
438 #define PWM_TNCR_TXNCTR_Msk (0xffffu << PWM_TNCR_TXNCTR_Pos)
439 #define PWM_TNCR_TXNCTR(value) ((PWM_TNCR_TXNCTR_Msk & ((value) << PWM_TNCR_TXNCTR_Pos)))
440 /* -------- PWM_PTCR : (PWM Offset: 0x120) Transfer Control Register -------- */
441 #define PWM_PTCR_RXTEN (0x1u << 0)
442 #define PWM_PTCR_RXTDIS (0x1u << 1)
443 #define PWM_PTCR_TXTEN (0x1u << 8)
444 #define PWM_PTCR_TXTDIS (0x1u << 9)
445 /* -------- PWM_PTSR : (PWM Offset: 0x124) Transfer Status Register -------- */
446 #define PWM_PTSR_RXTEN (0x1u << 0)
447 #define PWM_PTSR_TXTEN (0x1u << 8)
448 /* -------- PWM_CMPV : (PWM Offset: N/A) PWM Comparison 0 Value Register -------- */
449 #define PWM_CMPV_CV_Pos 0
450 #define PWM_CMPV_CV_Msk (0xffffffu << PWM_CMPV_CV_Pos)
451 #define PWM_CMPV_CV(value) ((PWM_CMPV_CV_Msk & ((value) << PWM_CMPV_CV_Pos)))
452 #define PWM_CMPV_CVM (0x1u << 24)
453 /* -------- PWM_CMPVUPD : (PWM Offset: N/A) PWM Comparison 0 Value Update Register -------- */
454 #define PWM_CMPVUPD_CVUPD_Pos 0
455 #define PWM_CMPVUPD_CVUPD_Msk (0xffffffu << PWM_CMPVUPD_CVUPD_Pos)
456 #define PWM_CMPVUPD_CVUPD(value) ((PWM_CMPVUPD_CVUPD_Msk & ((value) << PWM_CMPVUPD_CVUPD_Pos)))
457 #define PWM_CMPVUPD_CVMUPD (0x1u << 24)
458 /* -------- PWM_CMPM : (PWM Offset: N/A) PWM Comparison 0 Mode Register -------- */
459 #define PWM_CMPM_CEN (0x1u << 0)
460 #define PWM_CMPM_CTR_Pos 4
461 #define PWM_CMPM_CTR_Msk (0xfu << PWM_CMPM_CTR_Pos)
462 #define PWM_CMPM_CTR(value) ((PWM_CMPM_CTR_Msk & ((value) << PWM_CMPM_CTR_Pos)))
463 #define PWM_CMPM_CPR_Pos 8
464 #define PWM_CMPM_CPR_Msk (0xfu << PWM_CMPM_CPR_Pos)
465 #define PWM_CMPM_CPR(value) ((PWM_CMPM_CPR_Msk & ((value) << PWM_CMPM_CPR_Pos)))
466 #define PWM_CMPM_CPRCNT_Pos 12
467 #define PWM_CMPM_CPRCNT_Msk (0xfu << PWM_CMPM_CPRCNT_Pos)
468 #define PWM_CMPM_CPRCNT(value) ((PWM_CMPM_CPRCNT_Msk & ((value) << PWM_CMPM_CPRCNT_Pos)))
469 #define PWM_CMPM_CUPR_Pos 16
470 #define PWM_CMPM_CUPR_Msk (0xfu << PWM_CMPM_CUPR_Pos)
471 #define PWM_CMPM_CUPR(value) ((PWM_CMPM_CUPR_Msk & ((value) << PWM_CMPM_CUPR_Pos)))
472 #define PWM_CMPM_CUPRCNT_Pos 20
473 #define PWM_CMPM_CUPRCNT_Msk (0xfu << PWM_CMPM_CUPRCNT_Pos)
474 #define PWM_CMPM_CUPRCNT(value) ((PWM_CMPM_CUPRCNT_Msk & ((value) << PWM_CMPM_CUPRCNT_Pos)))
475 /* -------- PWM_CMPMUPD : (PWM Offset: N/A) PWM Comparison 0 Mode Update Register -------- */
476 #define PWM_CMPMUPD_CENUPD (0x1u << 0)
477 #define PWM_CMPMUPD_CTRUPD_Pos 4
478 #define PWM_CMPMUPD_CTRUPD_Msk (0xfu << PWM_CMPMUPD_CTRUPD_Pos)
479 #define PWM_CMPMUPD_CTRUPD(value) ((PWM_CMPMUPD_CTRUPD_Msk & ((value) << PWM_CMPMUPD_CTRUPD_Pos)))
480 #define PWM_CMPMUPD_CPRUPD_Pos 8
481 #define PWM_CMPMUPD_CPRUPD_Msk (0xfu << PWM_CMPMUPD_CPRUPD_Pos)
482 #define PWM_CMPMUPD_CPRUPD(value) ((PWM_CMPMUPD_CPRUPD_Msk & ((value) << PWM_CMPMUPD_CPRUPD_Pos)))
483 #define PWM_CMPMUPD_CUPRUPD_Pos 16
484 #define PWM_CMPMUPD_CUPRUPD_Msk (0xfu << PWM_CMPMUPD_CUPRUPD_Pos)
485 #define PWM_CMPMUPD_CUPRUPD(value) ((PWM_CMPMUPD_CUPRUPD_Msk & ((value) << PWM_CMPMUPD_CUPRUPD_Pos)))
486 /* -------- PWM_CMR : (PWM Offset: N/A) PWM Channel Mode Register -------- */
487 #define PWM_CMR_CPRE_Pos 0
488 #define PWM_CMR_CPRE_Msk (0xfu << PWM_CMR_CPRE_Pos)
489 #define PWM_CMR_CPRE_MCK (0x0u << 0)
490 #define PWM_CMR_CPRE_MCK_DIV_2 (0x1u << 0)
491 #define PWM_CMR_CPRE_MCK_DIV_4 (0x2u << 0)
492 #define PWM_CMR_CPRE_MCK_DIV_8 (0x3u << 0)
493 #define PWM_CMR_CPRE_MCK_DIV_16 (0x4u << 0)
494 #define PWM_CMR_CPRE_MCK_DIV_32 (0x5u << 0)
495 #define PWM_CMR_CPRE_MCK_DIV_64 (0x6u << 0)
496 #define PWM_CMR_CPRE_MCK_DIV_128 (0x7u << 0)
497 #define PWM_CMR_CPRE_MCK_DIV_256 (0x8u << 0)
498 #define PWM_CMR_CPRE_MCK_DIV_512 (0x9u << 0)
499 #define PWM_CMR_CPRE_MCK_DIV_1024 (0xAu << 0)
500 #define PWM_CMR_CPRE_CLKA (0xBu << 0)
501 #define PWM_CMR_CPRE_CLKB (0xCu << 0)
502 #define PWM_CMR_CALG (0x1u << 8)
503 #define PWM_CMR_CPOL (0x1u << 9)
504 #define PWM_CMR_CES (0x1u << 10)
505 #define PWM_CMR_DTE (0x1u << 16)
506 #define PWM_CMR_DTHI (0x1u << 17)
507 #define PWM_CMR_DTLI (0x1u << 18)
508 /* -------- PWM_CDTY : (PWM Offset: N/A) PWM Channel Duty Cycle Register -------- */
509 #define PWM_CDTY_CDTY_Pos 0
510 #define PWM_CDTY_CDTY_Msk (0xffffffu << PWM_CDTY_CDTY_Pos)
511 #define PWM_CDTY_CDTY(value) ((PWM_CDTY_CDTY_Msk & ((value) << PWM_CDTY_CDTY_Pos)))
512 /* -------- PWM_CDTYUPD : (PWM Offset: N/A) PWM Channel Duty Cycle Update Register -------- */
513 #define PWM_CDTYUPD_CDTYUPD_Pos 0
514 #define PWM_CDTYUPD_CDTYUPD_Msk (0xffffffu << PWM_CDTYUPD_CDTYUPD_Pos)
515 #define PWM_CDTYUPD_CDTYUPD(value) ((PWM_CDTYUPD_CDTYUPD_Msk & ((value) << PWM_CDTYUPD_CDTYUPD_Pos)))
516 /* -------- PWM_CPRD : (PWM Offset: N/A) PWM Channel Period Register -------- */
517 #define PWM_CPRD_CPRD_Pos 0
518 #define PWM_CPRD_CPRD_Msk (0xffffffu << PWM_CPRD_CPRD_Pos)
519 #define PWM_CPRD_CPRD(value) ((PWM_CPRD_CPRD_Msk & ((value) << PWM_CPRD_CPRD_Pos)))
520 /* -------- PWM_CPRDUPD : (PWM Offset: N/A) PWM Channel Period Update Register -------- */
521 #define PWM_CPRDUPD_CPRDUPD_Pos 0
522 #define PWM_CPRDUPD_CPRDUPD_Msk (0xffffffu << PWM_CPRDUPD_CPRDUPD_Pos)
523 #define PWM_CPRDUPD_CPRDUPD(value) ((PWM_CPRDUPD_CPRDUPD_Msk & ((value) << PWM_CPRDUPD_CPRDUPD_Pos)))
524 /* -------- PWM_CCNT : (PWM Offset: N/A) PWM Channel Counter Register -------- */
525 #define PWM_CCNT_CNT_Pos 0
526 #define PWM_CCNT_CNT_Msk (0xffffffu << PWM_CCNT_CNT_Pos)
527 /* -------- PWM_DT : (PWM Offset: N/A) PWM Channel Dead Time Register -------- */
528 #define PWM_DT_DTH_Pos 0
529 #define PWM_DT_DTH_Msk (0xffffu << PWM_DT_DTH_Pos)
530 #define PWM_DT_DTH(value) ((PWM_DT_DTH_Msk & ((value) << PWM_DT_DTH_Pos)))
531 #define PWM_DT_DTL_Pos 16
532 #define PWM_DT_DTL_Msk (0xffffu << PWM_DT_DTL_Pos)
533 #define PWM_DT_DTL(value) ((PWM_DT_DTL_Msk & ((value) << PWM_DT_DTL_Pos)))
534 /* -------- PWM_DTUPD : (PWM Offset: N/A) PWM Channel Dead Time Update Register -------- */
535 #define PWM_DTUPD_DTHUPD_Pos 0
536 #define PWM_DTUPD_DTHUPD_Msk (0xffffu << PWM_DTUPD_DTHUPD_Pos)
537 #define PWM_DTUPD_DTHUPD(value) ((PWM_DTUPD_DTHUPD_Msk & ((value) << PWM_DTUPD_DTHUPD_Pos)))
538 #define PWM_DTUPD_DTLUPD_Pos 16
539 #define PWM_DTUPD_DTLUPD_Msk (0xffffu << PWM_DTUPD_DTLUPD_Pos)
540 #define PWM_DTUPD_DTLUPD(value) ((PWM_DTUPD_DTLUPD_Msk & ((value) << PWM_DTUPD_DTLUPD_Pos)))
541 
545 #endif /* _SAM3S_PWM_COMPONENT_ */
RoReg PWM_ISR1
(Pwm Offset: 0x1C) PWM Interrupt Status Register 1
Definition: component_pwm.h:69
RoReg PWM_ISR2
(Pwm Offset: 0x40) PWM Interrupt Status Register 2
Definition: component_pwm.h:78
WoReg PWM_IER2
(Pwm Offset: 0x34) PWM Interrupt Enable Register 2
Definition: component_pwm.h:75
RoReg PWM_FSR
(Pwm Offset: 0x60) PWM Fault Status Register
Definition: component_pwm.h:86
RwReg PWM_OOV
(Pwm Offset: 0x44) PWM Output Override Value Register
Definition: component_pwm.h:79
WoReg PWM_OSS
(Pwm Offset: 0x4C) PWM Output Selection Set Register
Definition: component_pwm.h:81
RwReg PWM_DTUPD
(PwmCh_num Offset: 0x1C) PWM Channel Dead Time Update Register
Definition: component_pwm.h:49
volatile uint32_t RwReg
Definition: sam3n00a.h:54
PwmCh_num hardware registers.
Definition: component_pwm.h:41
RoReg PWM_PTSR
(Pwm Offset: 0x124) Transfer Status Register
Definition: component_pwm.h:104
RwReg PWM_FPE
(Pwm Offset: 0x6C) PWM Fault Protection Enable Register
Definition: component_pwm.h:89
#define PWMCH_NUM_NUMBER
Pwm hardware registers.
Definition: component_pwm.h:50
RwReg PWM_SCM
(Pwm Offset: 0x20) PWM Sync Channels Mode Register
Definition: component_pwm.h:70
RwReg PWM_CLK
(Pwm Offset: 0x00) PWM Clock Register
Definition: component_pwm.h:62
volatile uint32_t WoReg
Definition: sam3n00a.h:53
RwReg PWM_FPV
(Pwm Offset: 0x68) PWM Fault Protection Value Register
Definition: component_pwm.h:88
RwReg PWM_TCR
(Pwm Offset: 0x10C) Transmit Counter Register
Definition: component_pwm.h:99
#define PWMCMP_NUMBER
Pwm hardware registers.
Definition: component_pwm.h:59
RwReg PWM_SCUC
(Pwm Offset: 0x28) PWM Sync Channels Update Control Register
Definition: component_pwm.h:72
RwReg PWM_CMPVUPD
(PwmCmp Offset: 0x4) PWM Comparison 0 Value Update Register
Definition: component_pwm.h:54
RwReg PWM_CDTYUPD
(PwmCh_num Offset: 0x8) PWM Channel Duty Cycle Update Register
Definition: component_pwm.h:44
WoReg PWM_SCUPUPD
(Pwm Offset: 0x30) PWM Sync Channels Update Period Update Register
Definition: component_pwm.h:74
RwReg PWM_TNCR
(Pwm Offset: 0x11C) Transmit Next Counter Register
Definition: component_pwm.h:102
WoReg PWM_IDR2
(Pwm Offset: 0x38) PWM Interrupt Disable Register 2
Definition: component_pwm.h:76
WoReg PWM_IDR1
(Pwm Offset: 0x14) PWM Interrupt Disable Register 1
Definition: component_pwm.h:67
Definition: component_pwm.h:51
RoReg PWM_IMR1
(Pwm Offset: 0x18) PWM Interrupt Mask Register 1
Definition: component_pwm.h:68
RwReg PWM_DT
(PwmCh_num Offset: 0x18) PWM Channel Dead Time Register
Definition: component_pwm.h:48
RwReg PWM_CMPV
(PwmCmp Offset: 0x0) PWM Comparison 0 Value Register
Definition: component_pwm.h:53
RwReg PWM_TNPR
(Pwm Offset: 0x118) Transmit Next Pointer Register
Definition: component_pwm.h:101
RwReg PWM_SMMR
(Pwm Offset: 0xB0) PWM Stepper Motor Mode Register
Definition: component_pwm.h:93
RwReg PWM_CMPM
(PwmCmp Offset: 0x8) PWM Comparison 0 Mode Register
Definition: component_pwm.h:55
RwReg PWM_SCUP
(Pwm Offset: 0x2C) PWM Sync Channels Update Period Register
Definition: component_pwm.h:73
volatile const uint32_t RoReg
Definition: sam3n00a.h:49
WoReg PWM_OSC
(Pwm Offset: 0x50) PWM Output Selection Clear Register
Definition: component_pwm.h:82
RwReg PWM_CPRDUPD
(PwmCh_num Offset: 0x10) PWM Channel Period Update Register
Definition: component_pwm.h:46
RoReg PWM_WPSR
(Pwm Offset: 0xE8) PWM Write Protect Status Register
Definition: component_pwm.h:96
WoReg PWM_PTCR
(Pwm Offset: 0x120) Transfer Control Register
Definition: component_pwm.h:103
WoReg PWM_WPCR
(Pwm Offset: 0xE4) PWM Write Protect Control Register
Definition: component_pwm.h:95
WoReg PWM_FCR
(Pwm Offset: 0x64) PWM Fault Clear Register
Definition: component_pwm.h:87
RwReg PWM_CMPMUPD
(PwmCmp Offset: 0xC) PWM Comparison 0 Mode Update Register
Definition: component_pwm.h:56
WoReg PWM_OSCUPD
(Pwm Offset: 0x58) PWM Output Selection Clear Update Register
Definition: component_pwm.h:84
RoReg PWM_IMR2
(Pwm Offset: 0x3C) PWM Interrupt Mask Register 2
Definition: component_pwm.h:77
WoReg PWM_OSSUPD
(Pwm Offset: 0x54) PWM Output Selection Set Update Register
Definition: component_pwm.h:83
RwReg PWM_OS
(Pwm Offset: 0x48) PWM Output Selection Register
Definition: component_pwm.h:80
RwReg PWM_FMR
(Pwm Offset: 0x5C) PWM Fault Mode Register
Definition: component_pwm.h:85
WoReg PWM_IER1
(Pwm Offset: 0x10) PWM Interrupt Enable Register 1
Definition: component_pwm.h:66
PwmCmp hardware registers.
Definition: component_pwm.h:52
RwReg PWM_TPR
(Pwm Offset: 0x108) Transmit Pointer Register
Definition: component_pwm.h:98