1
/* Copyright (c) 2009-2010 Atmel Corporation
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in
12
the documentation and/or other materials provided with the
15
* Neither the name of the copyright holders nor the names of
16
contributors may be used to endorse or promote products derived
17
from this software without specific prior written permission.
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
POSSIBILITY OF SUCH DAMAGE. */
31
/* $Id: iox192a3.h 2218 2011-02-21 19:43:03Z arcanum $ */
33
/* avr/iox192a3.h - definitions for ATxmega192A3 */
35
/* This file should only be included from <avr/io.h>, never directly. */
38
# error "Include <avr/io.h> instead of this file."
42
# define _AVR_IOXXX_H_ "iox192a3.h"
44
# error "Attempt to include more than one <avr/ioXXX.h> file."
48
#ifndef _AVR_ATxmega192A3_H_
49
#define _AVR_ATxmega192A3_H_ 1
52
/* Ungrouped common registers */
53
#define GPIOR0 _SFR_MEM8(0x0000) /* General Purpose IO Register 0 */
54
#define GPIOR1 _SFR_MEM8(0x0001) /* General Purpose IO Register 1 */
55
#define GPIOR2 _SFR_MEM8(0x0002) /* General Purpose IO Register 2 */
56
#define GPIOR3 _SFR_MEM8(0x0003) /* General Purpose IO Register 3 */
57
#define GPIOR4 _SFR_MEM8(0x0004) /* General Purpose IO Register 4 */
58
#define GPIOR5 _SFR_MEM8(0x0005) /* General Purpose IO Register 5 */
59
#define GPIOR6 _SFR_MEM8(0x0006) /* General Purpose IO Register 6 */
60
#define GPIOR7 _SFR_MEM8(0x0007) /* General Purpose IO Register 7 */
61
#define GPIOR8 _SFR_MEM8(0x0008) /* General Purpose IO Register 8 */
62
#define GPIOR9 _SFR_MEM8(0x0009) /* General Purpose IO Register 9 */
63
#define GPIORA _SFR_MEM8(0x000A) /* General Purpose IO Register 10 */
64
#define GPIORB _SFR_MEM8(0x000B) /* General Purpose IO Register 11 */
65
#define GPIORC _SFR_MEM8(0x000C) /* General Purpose IO Register 12 */
66
#define GPIORD _SFR_MEM8(0x000D) /* General Purpose IO Register 13 */
67
#define GPIORE _SFR_MEM8(0x000E) /* General Purpose IO Register 14 */
68
#define GPIORF _SFR_MEM8(0x000F) /* General Purpose IO Register 15 */
71
#define GPIO0 _SFR_MEM8(0x0000) /* General Purpose IO Register 0 */
72
#define GPIO1 _SFR_MEM8(0x0001) /* General Purpose IO Register 1 */
73
#define GPIO2 _SFR_MEM8(0x0002) /* General Purpose IO Register 2 */
74
#define GPIO3 _SFR_MEM8(0x0003) /* General Purpose IO Register 3 */
75
#define GPIO4 _SFR_MEM8(0x0004) /* General Purpose IO Register 4 */
76
#define GPIO5 _SFR_MEM8(0x0005) /* General Purpose IO Register 5 */
77
#define GPIO6 _SFR_MEM8(0x0006) /* General Purpose IO Register 6 */
78
#define GPIO7 _SFR_MEM8(0x0007) /* General Purpose IO Register 7 */
79
#define GPIO8 _SFR_MEM8(0x0008) /* General Purpose IO Register 8 */
80
#define GPIO9 _SFR_MEM8(0x0009) /* General Purpose IO Register 9 */
81
#define GPIOA _SFR_MEM8(0x000A) /* General Purpose IO Register 10 */
82
#define GPIOB _SFR_MEM8(0x000B) /* General Purpose IO Register 11 */
83
#define GPIOC _SFR_MEM8(0x000C) /* General Purpose IO Register 12 */
84
#define GPIOD _SFR_MEM8(0x000D) /* General Purpose IO Register 13 */
85
#define GPIOE _SFR_MEM8(0x000E) /* General Purpose IO Register 14 */
86
#define GPIOF _SFR_MEM8(0x000F) /* General Purpose IO Register 15 */
88
#define CCP _SFR_MEM8(0x0034) /* Configuration Change Protection */
89
#define RAMPD _SFR_MEM8(0x0038) /* Ramp D */
90
#define RAMPX _SFR_MEM8(0x0039) /* Ramp X */
91
#define RAMPY _SFR_MEM8(0x003A) /* Ramp Y */
92
#define RAMPZ _SFR_MEM8(0x003B) /* Ramp Z */
93
#define EIND _SFR_MEM8(0x003C) /* Extended Indirect Jump */
94
#define SPL _SFR_MEM8(0x003D) /* Stack Pointer Low */
95
#define SPH _SFR_MEM8(0x003E) /* Stack Pointer High */
96
#define SREG _SFR_MEM8(0x003F) /* Status Register */
100
#if !defined (__ASSEMBLER__)
104
typedef volatile uint8_t register8_t;
105
typedef volatile uint16_t register16_t;
106
typedef volatile uint32_t register32_t;
112
#define _WORDREGISTER(regname) \
113
__extension__ union \
115
register16_t regname; \
118
register8_t regname ## L; \
119
register8_t regname ## H; \
123
#ifdef _DWORDREGISTER
124
#undef _DWORDREGISTER
126
#define _DWORDREGISTER(regname) \
127
__extension__ union \
129
register32_t regname; \
132
register8_t regname ## 0; \
133
register8_t regname ## 1; \
134
register8_t regname ## 2; \
135
register8_t regname ## 3; \
141
==========================================================================
143
==========================================================================
148
--------------------------------------------------------------------------
149
XOCD - On-Chip Debug System
150
--------------------------------------------------------------------------
153
/* On-Chip Debug System */
154
typedef struct OCD_struct
156
register8_t OCDR0; /* OCD Register 0 */
157
register8_t OCDR1; /* OCD Register 1 */
162
typedef enum CCP_enum
164
CCP_SPM_gc = (0x9D<<0), /* SPM Instruction Protection */
165
CCP_IOREG_gc = (0xD8<<0), /* IO Register Protection */
170
--------------------------------------------------------------------------
172
--------------------------------------------------------------------------
176
typedef struct CLK_struct
178
register8_t CTRL; /* Control Register */
179
register8_t PSCTRL; /* Prescaler Control Register */
180
register8_t LOCK; /* Lock register */
181
register8_t RTCCTRL; /* RTC Control Register */
185
--------------------------------------------------------------------------
187
--------------------------------------------------------------------------
190
/* Power Reduction */
191
typedef struct PR_struct
193
register8_t PRGEN; /* General Power Reduction */
194
register8_t PRPA; /* Power Reduction Port A */
195
register8_t PRPB; /* Power Reduction Port B */
196
register8_t PRPC; /* Power Reduction Port C */
197
register8_t PRPD; /* Power Reduction Port D */
198
register8_t PRPE; /* Power Reduction Port E */
199
register8_t PRPF; /* Power Reduction Port F */
202
/* System Clock Selection */
203
typedef enum CLK_SCLKSEL_enum
205
CLK_SCLKSEL_RC2M_gc = (0x00<<0), /* Internal 2MHz RC Oscillator */
206
CLK_SCLKSEL_RC32M_gc = (0x01<<0), /* Internal 32MHz RC Oscillator */
207
CLK_SCLKSEL_RC32K_gc = (0x02<<0), /* Internal 32kHz RC Oscillator */
208
CLK_SCLKSEL_XOSC_gc = (0x03<<0), /* External Crystal Oscillator or Clock */
209
CLK_SCLKSEL_PLL_gc = (0x04<<0), /* Phase Locked Loop */
212
/* Prescaler A Division Factor */
213
typedef enum CLK_PSADIV_enum
215
CLK_PSADIV_1_gc = (0x00<<2), /* Divide by 1 */
216
CLK_PSADIV_2_gc = (0x01<<2), /* Divide by 2 */
217
CLK_PSADIV_4_gc = (0x03<<2), /* Divide by 4 */
218
CLK_PSADIV_8_gc = (0x05<<2), /* Divide by 8 */
219
CLK_PSADIV_16_gc = (0x07<<2), /* Divide by 16 */
220
CLK_PSADIV_32_gc = (0x09<<2), /* Divide by 32 */
221
CLK_PSADIV_64_gc = (0x0B<<2), /* Divide by 64 */
222
CLK_PSADIV_128_gc = (0x0D<<2), /* Divide by 128 */
223
CLK_PSADIV_256_gc = (0x0F<<2), /* Divide by 256 */
224
CLK_PSADIV_512_gc = (0x11<<2), /* Divide by 512 */
227
/* Prescaler B and C Division Factor */
228
typedef enum CLK_PSBCDIV_enum
230
CLK_PSBCDIV_1_1_gc = (0x00<<0), /* Divide B by 1 and C by 1 */
231
CLK_PSBCDIV_1_2_gc = (0x01<<0), /* Divide B by 1 and C by 2 */
232
CLK_PSBCDIV_4_1_gc = (0x02<<0), /* Divide B by 4 and C by 1 */
233
CLK_PSBCDIV_2_2_gc = (0x03<<0), /* Divide B by 2 and C by 2 */
236
/* RTC Clock Source */
237
typedef enum CLK_RTCSRC_enum
239
CLK_RTCSRC_ULP_gc = (0x00<<1), /* 1kHz from internal 32kHz ULP */
240
CLK_RTCSRC_TOSC_gc = (0x01<<1), /* 1kHz from 32kHz crystal oscillator on TOSC */
241
CLK_RTCSRC_RCOSC_gc = (0x02<<1), /* 1kHz from internal 32kHz RC oscillator */
242
CLK_RTCSRC_TOSC32_gc = (0x05<<1), /* 32kHz from 32kHz crystal oscillator on TOSC */
247
--------------------------------------------------------------------------
248
SLEEP - Sleep Controller
249
--------------------------------------------------------------------------
252
/* Sleep Controller */
253
typedef struct SLEEP_struct
255
register8_t CTRL; /* Control Register */
259
typedef enum SLEEP_SMODE_enum
261
SLEEP_SMODE_IDLE_gc = (0x00<<1), /* Idle mode */
262
SLEEP_SMODE_PDOWN_gc = (0x02<<1), /* Power-down Mode */
263
SLEEP_SMODE_PSAVE_gc = (0x03<<1), /* Power-save Mode */
264
SLEEP_SMODE_STDBY_gc = (0x06<<1), /* Standby Mode */
265
SLEEP_SMODE_ESTDBY_gc = (0x07<<1), /* Extended Standby Mode */
270
--------------------------------------------------------------------------
272
--------------------------------------------------------------------------
276
typedef struct OSC_struct
278
register8_t CTRL; /* Control Register */
279
register8_t STATUS; /* Status Register */
280
register8_t XOSCCTRL; /* External Oscillator Control Register */
281
register8_t XOSCFAIL; /* External Oscillator Failure Detection Register */
282
register8_t RC32KCAL; /* 32kHz Internal Oscillator Calibration Register */
283
register8_t PLLCTRL; /* PLL Control REgister */
284
register8_t DFLLCTRL; /* DFLL Control Register */
287
/* Oscillator Frequency Range */
288
typedef enum OSC_FRQRANGE_enum
290
OSC_FRQRANGE_04TO2_gc = (0x00<<6), /* 0.4 - 2 MHz */
291
OSC_FRQRANGE_2TO9_gc = (0x01<<6), /* 2 - 9 MHz */
292
OSC_FRQRANGE_9TO12_gc = (0x02<<6), /* 9 - 12 MHz */
293
OSC_FRQRANGE_12TO16_gc = (0x03<<6), /* 12 - 16 MHz */
296
/* External Oscillator Selection and Startup Time */
297
typedef enum OSC_XOSCSEL_enum
299
OSC_XOSCSEL_EXTCLK_gc = (0x00<<0), /* External Clock - 6 CLK */
300
OSC_XOSCSEL_32KHz_gc = (0x02<<0), /* 32kHz TOSC - 32K CLK */
301
OSC_XOSCSEL_XTAL_256CLK_gc = (0x03<<0), /* 0.4-16MHz XTAL - 256 CLK */
302
OSC_XOSCSEL_XTAL_1KCLK_gc = (0x07<<0), /* 0.4-16MHz XTAL - 1K CLK */
303
OSC_XOSCSEL_XTAL_16KCLK_gc = (0x0B<<0), /* 0.4-16MHz XTAL - 16K CLK */
306
/* PLL Clock Source */
307
typedef enum OSC_PLLSRC_enum
309
OSC_PLLSRC_RC2M_gc = (0x00<<6), /* Internal 2MHz RC Oscillator */
310
OSC_PLLSRC_RC32M_gc = (0x02<<6), /* Internal 32MHz RC Oscillator */
311
OSC_PLLSRC_XOSC_gc = (0x03<<6), /* External Oscillator */
316
--------------------------------------------------------------------------
318
--------------------------------------------------------------------------
322
typedef struct DFLL_struct
324
register8_t CTRL; /* Control Register */
325
register8_t reserved_0x01;
326
register8_t CALA; /* Calibration Register A */
327
register8_t CALB; /* Calibration Register B */
328
register8_t COMP0; /* Oscillator Compare Register 0 */
329
register8_t COMP1; /* Oscillator Compare Register 1 */
330
register8_t COMP2; /* Oscillator Compare Register 2 */
331
register8_t reserved_0x07;
336
--------------------------------------------------------------------------
338
--------------------------------------------------------------------------
342
typedef struct RST_struct
344
register8_t STATUS; /* Status Register */
345
register8_t CTRL; /* Control Register */
350
--------------------------------------------------------------------------
351
WDT - Watch-Dog Timer
352
--------------------------------------------------------------------------
355
/* Watch-Dog Timer */
356
typedef struct WDT_struct
358
register8_t CTRL; /* Control */
359
register8_t WINCTRL; /* Windowed Mode Control */
360
register8_t STATUS; /* Status */
364
typedef enum WDT_PER_enum
366
WDT_PER_8CLK_gc = (0x00<<2), /* 8 cycles (8ms @ 3.3V) */
367
WDT_PER_16CLK_gc = (0x01<<2), /* 16 cycles (16ms @ 3.3V) */
368
WDT_PER_32CLK_gc = (0x02<<2), /* 32 cycles (32ms @ 3.3V) */
369
WDT_PER_64CLK_gc = (0x03<<2), /* 64 cycles (64ms @ 3.3V) */
370
WDT_PER_128CLK_gc = (0x04<<2), /* 128 cycles (0.125s @ 3.3V) */
371
WDT_PER_256CLK_gc = (0x05<<2), /* 256 cycles (0.25s @ 3.3V) */
372
WDT_PER_512CLK_gc = (0x06<<2), /* 512 cycles (0.5s @ 3.3V) */
373
WDT_PER_1KCLK_gc = (0x07<<2), /* 1K cycles (1s @ 3.3V) */
374
WDT_PER_2KCLK_gc = (0x08<<2), /* 2K cycles (2s @ 3.3V) */
375
WDT_PER_4KCLK_gc = (0x09<<2), /* 4K cycles (4s @ 3.3V) */
376
WDT_PER_8KCLK_gc = (0x0A<<2), /* 8K cycles (8s @ 3.3V) */
379
/* Closed window period */
380
typedef enum WDT_WPER_enum
382
WDT_WPER_8CLK_gc = (0x00<<2), /* 8 cycles (8ms @ 3.3V) */
383
WDT_WPER_16CLK_gc = (0x01<<2), /* 16 cycles (16ms @ 3.3V) */
384
WDT_WPER_32CLK_gc = (0x02<<2), /* 32 cycles (32ms @ 3.3V) */
385
WDT_WPER_64CLK_gc = (0x03<<2), /* 64 cycles (64ms @ 3.3V) */
386
WDT_WPER_128CLK_gc = (0x04<<2), /* 128 cycles (0.125s @ 3.3V) */
387
WDT_WPER_256CLK_gc = (0x05<<2), /* 256 cycles (0.25s @ 3.3V) */
388
WDT_WPER_512CLK_gc = (0x06<<2), /* 512 cycles (0.5s @ 3.3V) */
389
WDT_WPER_1KCLK_gc = (0x07<<2), /* 1K cycles (1s @ 3.3V) */
390
WDT_WPER_2KCLK_gc = (0x08<<2), /* 2K cycles (2s @ 3.3V) */
391
WDT_WPER_4KCLK_gc = (0x09<<2), /* 4K cycles (4s @ 3.3V) */
392
WDT_WPER_8KCLK_gc = (0x0A<<2), /* 8K cycles (8s @ 3.3V) */
397
--------------------------------------------------------------------------
399
--------------------------------------------------------------------------
403
typedef struct MCU_struct
405
register8_t DEVID0; /* Device ID byte 0 */
406
register8_t DEVID1; /* Device ID byte 1 */
407
register8_t DEVID2; /* Device ID byte 2 */
408
register8_t REVID; /* Revision ID */
409
register8_t JTAGUID; /* JTAG User ID */
410
register8_t reserved_0x05;
411
register8_t MCUCR; /* MCU Control */
412
register8_t reserved_0x07;
413
register8_t EVSYSLOCK; /* Event System Lock */
414
register8_t AWEXLOCK; /* AWEX Lock */
415
register8_t reserved_0x0A;
416
register8_t reserved_0x0B;
421
--------------------------------------------------------------------------
422
PMIC - Programmable Multi-level Interrupt Controller
423
--------------------------------------------------------------------------
426
/* Programmable Multi-level Interrupt Controller */
427
typedef struct PMIC_struct
429
register8_t STATUS; /* Status Register */
430
register8_t INTPRI; /* Interrupt Priority */
431
register8_t CTRL; /* Control Register */
436
--------------------------------------------------------------------------
438
--------------------------------------------------------------------------
442
typedef struct DMA_CH_struct
444
register8_t CTRLA; /* Channel Control */
445
register8_t CTRLB; /* Channel Control */
446
register8_t ADDRCTRL; /* Address Control */
447
register8_t TRIGSRC; /* Channel Trigger Source */
448
_WORDREGISTER(TRFCNT); /* Channel Block Transfer Count */
449
register8_t REPCNT; /* Channel Repeat Count */
450
register8_t reserved_0x07;
451
register8_t SRCADDR0; /* Channel Source Address 0 */
452
register8_t SRCADDR1; /* Channel Source Address 1 */
453
register8_t SRCADDR2; /* Channel Source Address 2 */
454
register8_t reserved_0x0B;
455
register8_t DESTADDR0; /* Channel Destination Address 0 */
456
register8_t DESTADDR1; /* Channel Destination Address 1 */
457
register8_t DESTADDR2; /* Channel Destination Address 2 */
458
register8_t reserved_0x0F;
462
--------------------------------------------------------------------------
464
--------------------------------------------------------------------------
468
typedef struct DMA_struct
470
register8_t CTRL; /* Control */
471
register8_t reserved_0x01;
472
register8_t reserved_0x02;
473
register8_t INTFLAGS; /* Transfer Interrupt Status */
474
register8_t STATUS; /* Status */
475
register8_t reserved_0x05;
476
_WORDREGISTER(TEMP); /* Temporary Register For 16/24-bit Access */
477
register8_t reserved_0x08;
478
register8_t reserved_0x09;
479
register8_t reserved_0x0A;
480
register8_t reserved_0x0B;
481
register8_t reserved_0x0C;
482
register8_t reserved_0x0D;
483
register8_t reserved_0x0E;
484
register8_t reserved_0x0F;
485
DMA_CH_t CH0; /* DMA Channel 0 */
486
DMA_CH_t CH1; /* DMA Channel 1 */
487
DMA_CH_t CH2; /* DMA Channel 2 */
488
DMA_CH_t CH3; /* DMA Channel 3 */
492
typedef enum DMA_CH_BURSTLEN_enum
494
DMA_CH_BURSTLEN_1BYTE_gc = (0x00<<0), /* 1-byte burst mode */
495
DMA_CH_BURSTLEN_2BYTE_gc = (0x01<<0), /* 2-byte burst mode */
496
DMA_CH_BURSTLEN_4BYTE_gc = (0x02<<0), /* 4-byte burst mode */
497
DMA_CH_BURSTLEN_8BYTE_gc = (0x03<<0), /* 8-byte burst mode */
500
/* Source address reload mode */
501
typedef enum DMA_CH_SRCRELOAD_enum
503
DMA_CH_SRCRELOAD_NONE_gc = (0x00<<6), /* No reload */
504
DMA_CH_SRCRELOAD_BLOCK_gc = (0x01<<6), /* Reload at end of block */
505
DMA_CH_SRCRELOAD_BURST_gc = (0x02<<6), /* Reload at end of burst */
506
DMA_CH_SRCRELOAD_TRANSACTION_gc = (0x03<<6), /* Reload at end of transaction */
507
} DMA_CH_SRCRELOAD_t;
509
/* Source addressing mode */
510
typedef enum DMA_CH_SRCDIR_enum
512
DMA_CH_SRCDIR_FIXED_gc = (0x00<<4), /* Fixed */
513
DMA_CH_SRCDIR_INC_gc = (0x01<<4), /* Increment */
514
DMA_CH_SRCDIR_DEC_gc = (0x02<<4), /* Decrement */
517
/* Destination adress reload mode */
518
typedef enum DMA_CH_DESTRELOAD_enum
520
DMA_CH_DESTRELOAD_NONE_gc = (0x00<<2), /* No reload */
521
DMA_CH_DESTRELOAD_BLOCK_gc = (0x01<<2), /* Reload at end of block */
522
DMA_CH_DESTRELOAD_BURST_gc = (0x02<<2), /* Reload at end of burst */
523
DMA_CH_DESTRELOAD_TRANSACTION_gc = (0x03<<2), /* Reload at end of transaction */
524
} DMA_CH_DESTRELOAD_t;
526
/* Destination adressing mode */
527
typedef enum DMA_CH_DESTDIR_enum
529
DMA_CH_DESTDIR_FIXED_gc = (0x00<<0), /* Fixed */
530
DMA_CH_DESTDIR_INC_gc = (0x01<<0), /* Increment */
531
DMA_CH_DESTDIR_DEC_gc = (0x02<<0), /* Decrement */
534
/* Transfer trigger source */
535
typedef enum DMA_CH_TRIGSRC_enum
537
DMA_CH_TRIGSRC_OFF_gc = (0x00<<0), /* Off software triggers only */
538
DMA_CH_TRIGSRC_EVSYS_CH0_gc = (0x01<<0), /* Event System Channel 0 */
539
DMA_CH_TRIGSRC_EVSYS_CH1_gc = (0x02<<0), /* Event System Channel 1 */
540
DMA_CH_TRIGSRC_EVSYS_CH2_gc = (0x03<<0), /* Event System Channel 2 */
541
DMA_CH_TRIGSRC_ADCA_CH0_gc = (0x10<<0), /* ADCA Channel 0 */
542
DMA_CH_TRIGSRC_ADCA_CH1_gc = (0x11<<0), /* ADCA Channel 1 */
543
DMA_CH_TRIGSRC_ADCA_CH2_gc = (0x12<<0), /* ADCA Channel 2 */
544
DMA_CH_TRIGSRC_ADCA_CH3_gc = (0x13<<0), /* ADCA Channel 3 */
545
DMA_CH_TRIGSRC_ADCA_CH4_gc = (0x14<<0), /* ADCA Channel 0,1,2,3 combined */
546
DMA_CH_TRIGSRC_DACA_CH0_gc = (0x15<<0), /* DACA Channel 0 */
547
DMA_CH_TRIGSRC_DACA_CH1_gc = (0x16<<0), /* DACA Channel 1 */
548
DMA_CH_TRIGSRC_ADCB_CH0_gc = (0x20<<0), /* ADCB Channel 0 */
549
DMA_CH_TRIGSRC_ADCB_CH1_gc = (0x21<<0), /* ADCB Channel 1 */
550
DMA_CH_TRIGSRC_ADCB_CH2_gc = (0x22<<0), /* ADCB Channel 2 */
551
DMA_CH_TRIGSRC_ADCB_CH3_gc = (0x23<<0), /* ADCB Channel 3 */
552
DMA_CH_TRIGSRC_ADCB_CH4_gc = (0x24<<0), /* ADCB Channel 0,1,2,3 combined */
553
DMA_CH_TRIGSRC_DACB_CH0_gc = (0x25<<0), /* DACB Channel 0 */
554
DMA_CH_TRIGSRC_DACB_CH1_gc = (0x26<<0), /* DACB Channel 1 */
555
DMA_CH_TRIGSRC_TCC0_OVF_gc = (0x40<<0), /* Timer/Counter C0 Overflow */
556
DMA_CH_TRIGSRC_TCC0_ERR_gc = (0x41<<0), /* Timer/Counter C0 Error */
557
DMA_CH_TRIGSRC_TCC0_CCA_gc = (0x42<<0), /* Timer/Counter C0 Compare or Capture A */
558
DMA_CH_TRIGSRC_TCC0_CCB_gc = (0x43<<0), /* Timer/Counter C0 Compare or Capture B */
559
DMA_CH_TRIGSRC_TCC0_CCC_gc = (0x44<<0), /* Timer/Counter C0 Compare or Capture C */
560
DMA_CH_TRIGSRC_TCC0_CCD_gc = (0x45<<0), /* Timer/Counter C0 Compare or Capture D */
561
DMA_CH_TRIGSRC_TCC1_OVF_gc = (0x46<<0), /* Timer/Counter C1 Overflow */
562
DMA_CH_TRIGSRC_TCC1_ERR_gc = (0x47<<0), /* Timer/Counter C1 Error */
563
DMA_CH_TRIGSRC_TCC1_CCA_gc = (0x48<<0), /* Timer/Counter C1 Compare or Capture A */
564
DMA_CH_TRIGSRC_TCC1_CCB_gc = (0x49<<0), /* Timer/Counter C1 Compare or Capture B */
565
DMA_CH_TRIGSRC_SPIC_gc = (0x4A<<0), /* SPI C Transfer Complete */
566
DMA_CH_TRIGSRC_USARTC0_RXC_gc = (0x4B<<0), /* USART C0 Receive Complete */
567
DMA_CH_TRIGSRC_USARTC0_DRE_gc = (0x4C<<0), /* USART C0 Data Register Empty */
568
DMA_CH_TRIGSRC_USARTC1_RXC_gc = (0x4E<<0), /* USART C1 Receive Complete */
569
DMA_CH_TRIGSRC_USARTC1_DRE_gc = (0x4F<<0), /* USART C1 Data Register Empty */
570
DMA_CH_TRIGSRC_TCD0_OVF_gc = (0x60<<0), /* Timer/Counter D0 Overflow */
571
DMA_CH_TRIGSRC_TCD0_ERR_gc = (0x61<<0), /* Timer/Counter D0 Error */
572
DMA_CH_TRIGSRC_TCD0_CCA_gc = (0x62<<0), /* Timer/Counter D0 Compare or Capture A */
573
DMA_CH_TRIGSRC_TCD0_CCB_gc = (0x63<<0), /* Timer/Counter D0 Compare or Capture B */
574
DMA_CH_TRIGSRC_TCD0_CCC_gc = (0x64<<0), /* Timer/Counter D0 Compare or Capture C */
575
DMA_CH_TRIGSRC_TCD0_CCD_gc = (0x65<<0), /* Timer/Counter D0 Compare or Capture D */
576
DMA_CH_TRIGSRC_TCD1_OVF_gc = (0x66<<0), /* Timer/Counter D1 Overflow */
577
DMA_CH_TRIGSRC_TCD1_ERR_gc = (0x67<<0), /* Timer/Counter D1 Error */
578
DMA_CH_TRIGSRC_TCD1_CCA_gc = (0x68<<0), /* Timer/Counter D1 Compare or Capture A */
579
DMA_CH_TRIGSRC_TCD1_CCB_gc = (0x69<<0), /* Timer/Counter D1 Compare or Capture B */
580
DMA_CH_TRIGSRC_SPID_gc = (0x6A<<0), /* SPI D Transfer Complete */
581
DMA_CH_TRIGSRC_USARTD0_RXC_gc = (0x6B<<0), /* USART D0 Receive Complete */
582
DMA_CH_TRIGSRC_USARTD0_DRE_gc = (0x6C<<0), /* USART D0 Data Register Empty */
583
DMA_CH_TRIGSRC_USARTD1_RXC_gc = (0x6E<<0), /* USART D1 Receive Complete */
584
DMA_CH_TRIGSRC_USARTD1_DRE_gc = (0x6F<<0), /* USART D1 Data Register Empty */
585
DMA_CH_TRIGSRC_TCE0_OVF_gc = (0x80<<0), /* Timer/Counter E0 Overflow */
586
DMA_CH_TRIGSRC_TCE0_ERR_gc = (0x81<<0), /* Timer/Counter E0 Error */
587
DMA_CH_TRIGSRC_TCE0_CCA_gc = (0x82<<0), /* Timer/Counter E0 Compare or Capture A */
588
DMA_CH_TRIGSRC_TCE0_CCB_gc = (0x83<<0), /* Timer/Counter E0 Compare or Capture B */
589
DMA_CH_TRIGSRC_TCE0_CCC_gc = (0x84<<0), /* Timer/Counter E0 Compare or Capture C */
590
DMA_CH_TRIGSRC_TCE0_CCD_gc = (0x85<<0), /* Timer/Counter E0 Compare or Capture D */
591
DMA_CH_TRIGSRC_TCE1_OVF_gc = (0x86<<0), /* Timer/Counter E1 Overflow */
592
DMA_CH_TRIGSRC_TCE1_ERR_gc = (0x87<<0), /* Timer/Counter E1 Error */
593
DMA_CH_TRIGSRC_TCE1_CCA_gc = (0x88<<0), /* Timer/Counter E1 Compare or Capture A */
594
DMA_CH_TRIGSRC_TCE1_CCB_gc = (0x89<<0), /* Timer/Counter E1 Compare or Capture B */
595
DMA_CH_TRIGSRC_SPIE_gc = (0x8A<<0), /* SPI E Transfer Complete */
596
DMA_CH_TRIGSRC_USARTE0_RXC_gc = (0x8B<<0), /* USART E0 Receive Complete */
597
DMA_CH_TRIGSRC_USARTE0_DRE_gc = (0x8C<<0), /* USART E0 Data Register Empty */
598
DMA_CH_TRIGSRC_USARTE1_RXC_gc = (0x8E<<0), /* USART E1 Receive Complete */
599
DMA_CH_TRIGSRC_USARTE1_DRE_gc = (0x8F<<0), /* USART E1 Data Register Empty */
600
DMA_CH_TRIGSRC_TCF0_OVF_gc = (0xA0<<0), /* Timer/Counter F0 Overflow */
601
DMA_CH_TRIGSRC_TCF0_ERR_gc = (0xA1<<0), /* Timer/Counter F0 Error */
602
DMA_CH_TRIGSRC_TCF0_CCA_gc = (0xA2<<0), /* Timer/Counter F0 Compare or Capture A */
603
DMA_CH_TRIGSRC_TCF0_CCB_gc = (0xA3<<0), /* Timer/Counter F0 Compare or Capture B */
604
DMA_CH_TRIGSRC_TCF0_CCC_gc = (0xA4<<0), /* Timer/Counter F0 Compare or Capture C */
605
DMA_CH_TRIGSRC_TCF0_CCD_gc = (0xA5<<0), /* Timer/Counter F0 Compare or Capture D */
606
DMA_CH_TRIGSRC_TCF1_OVF_gc = (0xA6<<0), /* Timer/Counter F1 Overflow */
607
DMA_CH_TRIGSRC_TCF1_ERR_gc = (0xA7<<0), /* Timer/Counter F1 Error */
608
DMA_CH_TRIGSRC_TCF1_CCA_gc = (0xA8<<0), /* Timer/Counter F1 Compare or Capture A */
609
DMA_CH_TRIGSRC_TCF1_CCB_gc = (0xA9<<0), /* Timer/Counter F1 Compare or Capture B */
610
DMA_CH_TRIGSRC_SPIF_gc = (0xAA<<0), /* SPI F Transfer Complete */
611
DMA_CH_TRIGSRC_USARTF0_RXC_gc = (0xAB<<0), /* USART F0 Receive Complete */
612
DMA_CH_TRIGSRC_USARTF0_DRE_gc = (0xAC<<0), /* USART F0 Data Register Empty */
613
DMA_CH_TRIGSRC_USARTF1_RXC_gc = (0xAE<<0), /* USART F1 Receive Complete */
614
DMA_CH_TRIGSRC_USARTF1_DRE_gc = (0xAF<<0), /* USART F1 Data Register Empty */
617
/* Double buffering mode */
618
typedef enum DMA_DBUFMODE_enum
620
DMA_DBUFMODE_DISABLED_gc = (0x00<<2), /* Double buffering disabled */
621
DMA_DBUFMODE_CH01_gc = (0x01<<2), /* Double buffering enabled on channel 0/1 */
622
DMA_DBUFMODE_CH23_gc = (0x02<<2), /* Double buffering enabled on channel 2/3 */
623
DMA_DBUFMODE_CH01CH23_gc = (0x03<<2), /* Double buffering enabled on ch. 0/1 and ch. 2/3 */
627
typedef enum DMA_PRIMODE_enum
629
DMA_PRIMODE_RR0123_gc = (0x00<<0), /* Round Robin */
630
DMA_PRIMODE_CH0RR123_gc = (0x01<<0), /* Channel 0 > Round Robin on channel 1/2/3 */
631
DMA_PRIMODE_CH01RR23_gc = (0x02<<0), /* Channel 0 > channel 1 > Round Robin on channel 2/3 */
632
DMA_PRIMODE_CH0123_gc = (0x03<<0), /* Channel 0 > channel 1 > channel 2 > channel 3 */
635
/* Interrupt level */
636
typedef enum DMA_CH_ERRINTLVL_enum
638
DMA_CH_ERRINTLVL_OFF_gc = (0x00<<2), /* Interrupt disabled */
639
DMA_CH_ERRINTLVL_LO_gc = (0x01<<2), /* Low level */
640
DMA_CH_ERRINTLVL_MED_gc = (0x02<<2), /* Medium level */
641
DMA_CH_ERRINTLVL_HI_gc = (0x03<<2), /* High level */
642
} DMA_CH_ERRINTLVL_t;
644
/* Interrupt level */
645
typedef enum DMA_CH_TRNINTLVL_enum
647
DMA_CH_TRNINTLVL_OFF_gc = (0x00<<0), /* Interrupt disabled */
648
DMA_CH_TRNINTLVL_LO_gc = (0x01<<0), /* Low level */
649
DMA_CH_TRNINTLVL_MED_gc = (0x02<<0), /* Medium level */
650
DMA_CH_TRNINTLVL_HI_gc = (0x03<<0), /* High level */
651
} DMA_CH_TRNINTLVL_t;
655
--------------------------------------------------------------------------
657
--------------------------------------------------------------------------
661
typedef struct EVSYS_struct
663
register8_t CH0MUX; /* Event Channel 0 Multiplexer */
664
register8_t CH1MUX; /* Event Channel 1 Multiplexer */
665
register8_t CH2MUX; /* Event Channel 2 Multiplexer */
666
register8_t CH3MUX; /* Event Channel 3 Multiplexer */
667
register8_t CH4MUX; /* Event Channel 4 Multiplexer */
668
register8_t CH5MUX; /* Event Channel 5 Multiplexer */
669
register8_t CH6MUX; /* Event Channel 6 Multiplexer */
670
register8_t CH7MUX; /* Event Channel 7 Multiplexer */
671
register8_t CH0CTRL; /* Channel 0 Control Register */
672
register8_t CH1CTRL; /* Channel 1 Control Register */
673
register8_t CH2CTRL; /* Channel 2 Control Register */
674
register8_t CH3CTRL; /* Channel 3 Control Register */
675
register8_t CH4CTRL; /* Channel 4 Control Register */
676
register8_t CH5CTRL; /* Channel 5 Control Register */
677
register8_t CH6CTRL; /* Channel 6 Control Register */
678
register8_t CH7CTRL; /* Channel 7 Control Register */
679
register8_t STROBE; /* Event Strobe */
680
register8_t DATA; /* Event Data */
683
/* Quadrature Decoder Index Recognition Mode */
684
typedef enum EVSYS_QDIRM_enum
686
EVSYS_QDIRM_00_gc = (0x00<<5), /* QDPH0 = 0, QDPH90 = 0 */
687
EVSYS_QDIRM_01_gc = (0x01<<5), /* QDPH0 = 0, QDPH90 = 1 */
688
EVSYS_QDIRM_10_gc = (0x02<<5), /* QDPH0 = 1, QDPH90 = 0 */
689
EVSYS_QDIRM_11_gc = (0x03<<5), /* QDPH0 = 1, QDPH90 = 1 */
692
/* Digital filter coefficient */
693
typedef enum EVSYS_DIGFILT_enum
695
EVSYS_DIGFILT_1SAMPLE_gc = (0x00<<0), /* 1 SAMPLE */
696
EVSYS_DIGFILT_2SAMPLES_gc = (0x01<<0), /* 2 SAMPLES */
697
EVSYS_DIGFILT_3SAMPLES_gc = (0x02<<0), /* 3 SAMPLES */
698
EVSYS_DIGFILT_4SAMPLES_gc = (0x03<<0), /* 4 SAMPLES */
699
EVSYS_DIGFILT_5SAMPLES_gc = (0x04<<0), /* 5 SAMPLES */
700
EVSYS_DIGFILT_6SAMPLES_gc = (0x05<<0), /* 6 SAMPLES */
701
EVSYS_DIGFILT_7SAMPLES_gc = (0x06<<0), /* 7 SAMPLES */
702
EVSYS_DIGFILT_8SAMPLES_gc = (0x07<<0), /* 8 SAMPLES */
705
/* Event Channel multiplexer input selection */
706
typedef enum EVSYS_CHMUX_enum
708
EVSYS_CHMUX_OFF_gc = (0x00<<0), /* Off */
709
EVSYS_CHMUX_RTC_OVF_gc = (0x08<<0), /* RTC Overflow */
710
EVSYS_CHMUX_RTC_CMP_gc = (0x09<<0), /* RTC Compare Match */
711
EVSYS_CHMUX_ACA_CH0_gc = (0x10<<0), /* Analog Comparator A Channel 0 */
712
EVSYS_CHMUX_ACA_CH1_gc = (0x11<<0), /* Analog Comparator A Channel 1 */
713
EVSYS_CHMUX_ACA_WIN_gc = (0x12<<0), /* Analog Comparator A Window */
714
EVSYS_CHMUX_ACB_CH0_gc = (0x13<<0), /* Analog Comparator B Channel 0 */
715
EVSYS_CHMUX_ACB_CH1_gc = (0x14<<0), /* Analog Comparator B Channel 1 */
716
EVSYS_CHMUX_ACB_WIN_gc = (0x15<<0), /* Analog Comparator B Window */
717
EVSYS_CHMUX_ADCA_CH0_gc = (0x20<<0), /* ADC A Channel 0 */
718
EVSYS_CHMUX_ADCA_CH1_gc = (0x21<<0), /* ADC A Channel 1 */
719
EVSYS_CHMUX_ADCA_CH2_gc = (0x22<<0), /* ADC A Channel 2 */
720
EVSYS_CHMUX_ADCA_CH3_gc = (0x23<<0), /* ADC A Channel 3 */
721
EVSYS_CHMUX_ADCB_CH0_gc = (0x24<<0), /* ADC B Channel 0 */
722
EVSYS_CHMUX_ADCB_CH1_gc = (0x25<<0), /* ADC B Channel 1 */
723
EVSYS_CHMUX_ADCB_CH2_gc = (0x26<<0), /* ADC B Channel 2 */
724
EVSYS_CHMUX_ADCB_CH3_gc = (0x27<<0), /* ADC B Channel 3 */
725
EVSYS_CHMUX_PORTA_PIN0_gc = (0x50<<0), /* Port A, Pin0 */
726
EVSYS_CHMUX_PORTA_PIN1_gc = (0x51<<0), /* Port A, Pin1 */
727
EVSYS_CHMUX_PORTA_PIN2_gc = (0x52<<0), /* Port A, Pin2 */
728
EVSYS_CHMUX_PORTA_PIN3_gc = (0x53<<0), /* Port A, Pin3 */
729
EVSYS_CHMUX_PORTA_PIN4_gc = (0x54<<0), /* Port A, Pin4 */
730
EVSYS_CHMUX_PORTA_PIN5_gc = (0x55<<0), /* Port A, Pin5 */
731
EVSYS_CHMUX_PORTA_PIN6_gc = (0x56<<0), /* Port A, Pin6 */
732
EVSYS_CHMUX_PORTA_PIN7_gc = (0x57<<0), /* Port A, Pin7 */
733
EVSYS_CHMUX_PORTB_PIN0_gc = (0x58<<0), /* Port B, Pin0 */
734
EVSYS_CHMUX_PORTB_PIN1_gc = (0x59<<0), /* Port B, Pin1 */
735
EVSYS_CHMUX_PORTB_PIN2_gc = (0x5A<<0), /* Port B, Pin2 */
736
EVSYS_CHMUX_PORTB_PIN3_gc = (0x5B<<0), /* Port B, Pin3 */
737
EVSYS_CHMUX_PORTB_PIN4_gc = (0x5C<<0), /* Port B, Pin4 */
738
EVSYS_CHMUX_PORTB_PIN5_gc = (0x5D<<0), /* Port B, Pin5 */
739
EVSYS_CHMUX_PORTB_PIN6_gc = (0x5E<<0), /* Port B, Pin6 */
740
EVSYS_CHMUX_PORTB_PIN7_gc = (0x5F<<0), /* Port B, Pin7 */
741
EVSYS_CHMUX_PORTC_PIN0_gc = (0x60<<0), /* Port C, Pin0 */
742
EVSYS_CHMUX_PORTC_PIN1_gc = (0x61<<0), /* Port C, Pin1 */
743
EVSYS_CHMUX_PORTC_PIN2_gc = (0x62<<0), /* Port C, Pin2 */
744
EVSYS_CHMUX_PORTC_PIN3_gc = (0x63<<0), /* Port C, Pin3 */
745
EVSYS_CHMUX_PORTC_PIN4_gc = (0x64<<0), /* Port C, Pin4 */
746
EVSYS_CHMUX_PORTC_PIN5_gc = (0x65<<0), /* Port C, Pin5 */
747
EVSYS_CHMUX_PORTC_PIN6_gc = (0x66<<0), /* Port C, Pin6 */
748
EVSYS_CHMUX_PORTC_PIN7_gc = (0x67<<0), /* Port C, Pin7 */
749
EVSYS_CHMUX_PORTD_PIN0_gc = (0x68<<0), /* Port D, Pin0 */
750
EVSYS_CHMUX_PORTD_PIN1_gc = (0x69<<0), /* Port D, Pin1 */
751
EVSYS_CHMUX_PORTD_PIN2_gc = (0x6A<<0), /* Port D, Pin2 */
752
EVSYS_CHMUX_PORTD_PIN3_gc = (0x6B<<0), /* Port D, Pin3 */
753
EVSYS_CHMUX_PORTD_PIN4_gc = (0x6C<<0), /* Port D, Pin4 */
754
EVSYS_CHMUX_PORTD_PIN5_gc = (0x6D<<0), /* Port D, Pin5 */
755
EVSYS_CHMUX_PORTD_PIN6_gc = (0x6E<<0), /* Port D, Pin6 */
756
EVSYS_CHMUX_PORTD_PIN7_gc = (0x6F<<0), /* Port D, Pin7 */
757
EVSYS_CHMUX_PORTE_PIN0_gc = (0x70<<0), /* Port E, Pin0 */
758
EVSYS_CHMUX_PORTE_PIN1_gc = (0x71<<0), /* Port E, Pin1 */
759
EVSYS_CHMUX_PORTE_PIN2_gc = (0x72<<0), /* Port E, Pin2 */
760
EVSYS_CHMUX_PORTE_PIN3_gc = (0x73<<0), /* Port E, Pin3 */
761
EVSYS_CHMUX_PORTE_PIN4_gc = (0x74<<0), /* Port E, Pin4 */
762
EVSYS_CHMUX_PORTE_PIN5_gc = (0x75<<0), /* Port E, Pin5 */
763
EVSYS_CHMUX_PORTE_PIN6_gc = (0x76<<0), /* Port E, Pin6 */
764
EVSYS_CHMUX_PORTE_PIN7_gc = (0x77<<0), /* Port E, Pin7 */
765
EVSYS_CHMUX_PORTF_PIN0_gc = (0x78<<0), /* Port F, Pin0 */
766
EVSYS_CHMUX_PORTF_PIN1_gc = (0x79<<0), /* Port F, Pin1 */
767
EVSYS_CHMUX_PORTF_PIN2_gc = (0x7A<<0), /* Port F, Pin2 */
768
EVSYS_CHMUX_PORTF_PIN3_gc = (0x7B<<0), /* Port F, Pin3 */
769
EVSYS_CHMUX_PORTF_PIN4_gc = (0x7C<<0), /* Port F, Pin4 */
770
EVSYS_CHMUX_PORTF_PIN5_gc = (0x7D<<0), /* Port F, Pin5 */
771
EVSYS_CHMUX_PORTF_PIN6_gc = (0x7E<<0), /* Port F, Pin6 */
772
EVSYS_CHMUX_PORTF_PIN7_gc = (0x7F<<0), /* Port F, Pin7 */
773
EVSYS_CHMUX_PRESCALER_1_gc = (0x80<<0), /* Prescaler, divide by 1 */
774
EVSYS_CHMUX_PRESCALER_2_gc = (0x81<<0), /* Prescaler, divide by 2 */
775
EVSYS_CHMUX_PRESCALER_4_gc = (0x82<<0), /* Prescaler, divide by 4 */
776
EVSYS_CHMUX_PRESCALER_8_gc = (0x83<<0), /* Prescaler, divide by 8 */
777
EVSYS_CHMUX_PRESCALER_16_gc = (0x84<<0), /* Prescaler, divide by 16 */
778
EVSYS_CHMUX_PRESCALER_32_gc = (0x85<<0), /* Prescaler, divide by 32 */
779
EVSYS_CHMUX_PRESCALER_64_gc = (0x86<<0), /* Prescaler, divide by 64 */
780
EVSYS_CHMUX_PRESCALER_128_gc = (0x87<<0), /* Prescaler, divide by 128 */
781
EVSYS_CHMUX_PRESCALER_256_gc = (0x88<<0), /* Prescaler, divide by 256 */
782
EVSYS_CHMUX_PRESCALER_512_gc = (0x89<<0), /* Prescaler, divide by 512 */
783
EVSYS_CHMUX_PRESCALER_1024_gc = (0x8A<<0), /* Prescaler, divide by 1024 */
784
EVSYS_CHMUX_PRESCALER_2048_gc = (0x8B<<0), /* Prescaler, divide by 2048 */
785
EVSYS_CHMUX_PRESCALER_4096_gc = (0x8C<<0), /* Prescaler, divide by 4096 */
786
EVSYS_CHMUX_PRESCALER_8192_gc = (0x8D<<0), /* Prescaler, divide by 8192 */
787
EVSYS_CHMUX_PRESCALER_16384_gc = (0x8E<<0), /* Prescaler, divide by 16384 */
788
EVSYS_CHMUX_PRESCALER_32768_gc = (0x8F<<0), /* Prescaler, divide by 32768 */
789
EVSYS_CHMUX_TCC0_OVF_gc = (0xC0<<0), /* Timer/Counter C0 Overflow */
790
EVSYS_CHMUX_TCC0_ERR_gc = (0xC1<<0), /* Timer/Counter C0 Error */
791
EVSYS_CHMUX_TCC0_CCA_gc = (0xC4<<0), /* Timer/Counter C0 Compare or Capture A */
792
EVSYS_CHMUX_TCC0_CCB_gc = (0xC5<<0), /* Timer/Counter C0 Compare or Capture B */
793
EVSYS_CHMUX_TCC0_CCC_gc = (0xC6<<0), /* Timer/Counter C0 Compare or Capture C */
794
EVSYS_CHMUX_TCC0_CCD_gc = (0xC7<<0), /* Timer/Counter C0 Compare or Capture D */
795
EVSYS_CHMUX_TCC1_OVF_gc = (0xC8<<0), /* Timer/Counter C1 Overflow */
796
EVSYS_CHMUX_TCC1_ERR_gc = (0xC9<<0), /* Timer/Counter C1 Error */
797
EVSYS_CHMUX_TCC1_CCA_gc = (0xCC<<0), /* Timer/Counter C1 Compare or Capture A */
798
EVSYS_CHMUX_TCC1_CCB_gc = (0xCD<<0), /* Timer/Counter C1 Compare or Capture B */
799
EVSYS_CHMUX_TCD0_OVF_gc = (0xD0<<0), /* Timer/Counter D0 Overflow */
800
EVSYS_CHMUX_TCD0_ERR_gc = (0xD1<<0), /* Timer/Counter D0 Error */
801
EVSYS_CHMUX_TCD0_CCA_gc = (0xD4<<0), /* Timer/Counter D0 Compare or Capture A */
802
EVSYS_CHMUX_TCD0_CCB_gc = (0xD5<<0), /* Timer/Counter D0 Compare or Capture B */
803
EVSYS_CHMUX_TCD0_CCC_gc = (0xD6<<0), /* Timer/Counter D0 Compare or Capture C */
804
EVSYS_CHMUX_TCD0_CCD_gc = (0xD7<<0), /* Timer/Counter D0 Compare or Capture D */
805
EVSYS_CHMUX_TCD1_OVF_gc = (0xD8<<0), /* Timer/Counter D1 Overflow */
806
EVSYS_CHMUX_TCD1_ERR_gc = (0xD9<<0), /* Timer/Counter D1 Error */
807
EVSYS_CHMUX_TCD1_CCA_gc = (0xDC<<0), /* Timer/Counter D1 Compare or Capture A */
808
EVSYS_CHMUX_TCD1_CCB_gc = (0xDD<<0), /* Timer/Counter D1 Compare or Capture B */
809
EVSYS_CHMUX_TCE0_OVF_gc = (0xE0<<0), /* Timer/Counter E0 Overflow */
810
EVSYS_CHMUX_TCE0_ERR_gc = (0xE1<<0), /* Timer/Counter E0 Error */
811
EVSYS_CHMUX_TCE0_CCA_gc = (0xE4<<0), /* Timer/Counter E0 Compare or Capture A */
812
EVSYS_CHMUX_TCE0_CCB_gc = (0xE5<<0), /* Timer/Counter E0 Compare or Capture B */
813
EVSYS_CHMUX_TCE0_CCC_gc = (0xE6<<0), /* Timer/Counter E0 Compare or Capture C */
814
EVSYS_CHMUX_TCE0_CCD_gc = (0xE7<<0), /* Timer/Counter E0 Compare or Capture D */
815
EVSYS_CHMUX_TCE1_OVF_gc = (0xE8<<0), /* Timer/Counter E1 Overflow */
816
EVSYS_CHMUX_TCE1_ERR_gc = (0xE9<<0), /* Timer/Counter E1 Error */
817
EVSYS_CHMUX_TCE1_CCA_gc = (0xEC<<0), /* Timer/Counter E1 Compare or Capture A */
818
EVSYS_CHMUX_TCE1_CCB_gc = (0xED<<0), /* Timer/Counter E1 Compare or Capture B */
819
EVSYS_CHMUX_TCF0_OVF_gc = (0xF0<<0), /* Timer/Counter F0 Overflow */
820
EVSYS_CHMUX_TCF0_ERR_gc = (0xF1<<0), /* Timer/Counter F0 Error */
821
EVSYS_CHMUX_TCF0_CCA_gc = (0xF4<<0), /* Timer/Counter F0 Compare or Capture A */
822
EVSYS_CHMUX_TCF0_CCB_gc = (0xF5<<0), /* Timer/Counter F0 Compare or Capture B */
823
EVSYS_CHMUX_TCF0_CCC_gc = (0xF6<<0), /* Timer/Counter F0 Compare or Capture C */
824
EVSYS_CHMUX_TCF0_CCD_gc = (0xF7<<0), /* Timer/Counter F0 Compare or Capture D */
825
EVSYS_CHMUX_TCF1_OVF_gc = (0xF8<<0), /* Timer/Counter F1 Overflow */
826
EVSYS_CHMUX_TCF1_ERR_gc = (0xF9<<0), /* Timer/Counter F1 Error */
827
EVSYS_CHMUX_TCF1_CCA_gc = (0xFC<<0), /* Timer/Counter F1 Compare or Capture A */
828
EVSYS_CHMUX_TCF1_CCB_gc = (0xFD<<0), /* Timer/Counter F1 Compare or Capture B */
833
--------------------------------------------------------------------------
834
NVM - Non Volatile Memory Controller
835
--------------------------------------------------------------------------
838
/* Non-volatile Memory Controller */
839
typedef struct NVM_struct
841
register8_t ADDR0; /* Address Register 0 */
842
register8_t ADDR1; /* Address Register 1 */
843
register8_t ADDR2; /* Address Register 2 */
844
register8_t reserved_0x03;
845
register8_t DATA0; /* Data Register 0 */
846
register8_t DATA1; /* Data Register 1 */
847
register8_t DATA2; /* Data Register 2 */
848
register8_t reserved_0x07;
849
register8_t reserved_0x08;
850
register8_t reserved_0x09;
851
register8_t CMD; /* Command */
852
register8_t CTRLA; /* Control Register A */
853
register8_t CTRLB; /* Control Register B */
854
register8_t INTCTRL; /* Interrupt Control */
855
register8_t reserved_0x0E;
856
register8_t STATUS; /* Status */
857
register8_t LOCKBITS; /* Lock Bits */
861
--------------------------------------------------------------------------
862
NVM - Non Volatile Memory Controller
863
--------------------------------------------------------------------------
867
typedef struct NVM_LOCKBITS_struct
869
register8_t LOCKBITS; /* Lock Bits */
873
--------------------------------------------------------------------------
874
NVM - Non Volatile Memory Controller
875
--------------------------------------------------------------------------
879
typedef struct NVM_FUSES_struct
881
register8_t FUSEBYTE0; /* JTAG User ID */
882
register8_t FUSEBYTE1; /* Watchdog Configuration */
883
register8_t FUSEBYTE2; /* Reset Configuration */
884
register8_t reserved_0x03;
885
register8_t FUSEBYTE4; /* Start-up Configuration */
886
register8_t FUSEBYTE5; /* EESAVE and BOD Level */
890
--------------------------------------------------------------------------
891
NVM - Non Volatile Memory Controller
892
--------------------------------------------------------------------------
895
/* Production Signatures */
896
typedef struct NVM_PROD_SIGNATURES_struct
898
register8_t RCOSC2M; /* RCOSC 2MHz Calibration Value */
899
register8_t reserved_0x01;
900
register8_t RCOSC32K; /* RCOSC 32kHz Calibration Value */
901
register8_t RCOSC32M; /* RCOSC 32MHz Calibration Value */
902
register8_t reserved_0x04;
903
register8_t reserved_0x05;
904
register8_t reserved_0x06;
905
register8_t reserved_0x07;
906
register8_t LOTNUM0; /* Lot Number Byte 0, ASCII */
907
register8_t LOTNUM1; /* Lot Number Byte 1, ASCII */
908
register8_t LOTNUM2; /* Lot Number Byte 2, ASCII */
909
register8_t LOTNUM3; /* Lot Number Byte 3, ASCII */
910
register8_t LOTNUM4; /* Lot Number Byte 4, ASCII */
911
register8_t LOTNUM5; /* Lot Number Byte 5, ASCII */
912
register8_t reserved_0x0E;
913
register8_t reserved_0x0F;
914
register8_t WAFNUM; /* Wafer Number */
915
register8_t reserved_0x11;
916
register8_t COORDX0; /* Wafer Coordinate X Byte 0 */
917
register8_t COORDX1; /* Wafer Coordinate X Byte 1 */
918
register8_t COORDY0; /* Wafer Coordinate Y Byte 0 */
919
register8_t COORDY1; /* Wafer Coordinate Y Byte 1 */
920
register8_t reserved_0x16;
921
register8_t reserved_0x17;
922
register8_t reserved_0x18;
923
register8_t reserved_0x19;
924
register8_t reserved_0x1A;
925
register8_t reserved_0x1B;
926
register8_t reserved_0x1C;
927
register8_t reserved_0x1D;
928
register8_t reserved_0x1E;
929
register8_t reserved_0x1F;
930
register8_t ADCACAL0; /* ADCA Calibration Byte 0 */
931
register8_t ADCACAL1; /* ADCA Calibration Byte 1 */
932
register8_t reserved_0x22;
933
register8_t reserved_0x23;
934
register8_t ADCBCAL0; /* ADCB Calibration Byte 0 */
935
register8_t ADCBCAL1; /* ADCB Calibration Byte 1 */
936
register8_t reserved_0x26;
937
register8_t reserved_0x27;
938
register8_t reserved_0x28;
939
register8_t reserved_0x29;
940
register8_t reserved_0x2A;
941
register8_t reserved_0x2B;
942
register8_t reserved_0x2C;
943
register8_t reserved_0x2D;
944
register8_t TEMPSENSE0; /* Temperature Sensor Calibration Byte 0 */
945
register8_t TEMPSENSE1; /* Temperature Sensor Calibration Byte 0 */
946
register8_t DACAOFFCAL; /* DACA Calibration Byte 0 */
947
register8_t DACAGAINCAL; /* DACA Calibration Byte 1 */
948
register8_t DACBOFFCAL; /* DACB Calibration Byte 0 */
949
register8_t DACBGAINCAL; /* DACB Calibration Byte 1 */
950
register8_t reserved_0x34;
951
register8_t reserved_0x35;
952
register8_t reserved_0x36;
953
register8_t reserved_0x37;
954
register8_t reserved_0x38;
955
register8_t reserved_0x39;
956
register8_t reserved_0x3A;
957
register8_t reserved_0x3B;
958
register8_t reserved_0x3C;
959
register8_t reserved_0x3D;
960
register8_t reserved_0x3E;
961
} NVM_PROD_SIGNATURES_t;
964
typedef enum NVM_CMD_enum
966
NVM_CMD_NO_OPERATION_gc = (0x00<<0), /* Noop/Ordinary LPM */
967
NVM_CMD_READ_CALIB_ROW_gc = (0x02<<0), /* Read calibration row */
968
NVM_CMD_READ_USER_SIG_ROW_gc = (0x01<<0), /* Read user signature row */
969
NVM_CMD_READ_EEPROM_gc = (0x06<<0), /* Read EEPROM */
970
NVM_CMD_READ_FUSES_gc = (0x07<<0), /* Read fuse byte */
971
NVM_CMD_WRITE_LOCK_BITS_gc = (0x08<<0), /* Write lock bits */
972
NVM_CMD_ERASE_USER_SIG_ROW_gc = (0x18<<0), /* Erase user signature row */
973
NVM_CMD_WRITE_USER_SIG_ROW_gc = (0x1A<<0), /* Write user signature row */
974
NVM_CMD_ERASE_APP_gc = (0x20<<0), /* Erase Application Section */
975
NVM_CMD_ERASE_APP_PAGE_gc = (0x22<<0), /* Erase Application Section page */
976
NVM_CMD_LOAD_FLASH_BUFFER_gc = (0x23<<0), /* Load Flash page buffer */
977
NVM_CMD_WRITE_APP_PAGE_gc = (0x24<<0), /* Write Application Section page */
978
NVM_CMD_ERASE_WRITE_APP_PAGE_gc = (0x25<<0), /* Erase-and-write Application Section page */
979
NVM_CMD_ERASE_FLASH_BUFFER_gc = (0x26<<0), /* Erase/flush Flash page buffer */
980
NVM_CMD_ERASE_BOOT_PAGE_gc = (0x2A<<0), /* Erase Boot Section page */
981
NVM_CMD_WRITE_BOOT_PAGE_gc = (0x2C<<0), /* Write Boot Section page */
982
NVM_CMD_ERASE_WRITE_BOOT_PAGE_gc = (0x2D<<0), /* Erase-and-write Boot Section page */
983
NVM_CMD_ERASE_EEPROM_gc = (0x30<<0), /* Erase EEPROM */
984
NVM_CMD_ERASE_EEPROM_PAGE_gc = (0x32<<0), /* Erase EEPROM page */
985
NVM_CMD_LOAD_EEPROM_BUFFER_gc = (0x33<<0), /* Load EEPROM page buffer */
986
NVM_CMD_WRITE_EEPROM_PAGE_gc = (0x34<<0), /* Write EEPROM page */
987
NVM_CMD_ERASE_WRITE_EEPROM_PAGE_gc = (0x35<<0), /* Erase-and-write EEPROM page */
988
NVM_CMD_ERASE_EEPROM_BUFFER_gc = (0x36<<0), /* Erase/flush EEPROM page buffer */
989
NVM_CMD_APP_CRC_gc = (0x38<<0), /* Generate Application section CRC */
990
NVM_CMD_BOOT_CRC_gc = (0x39<<0), /* Generate Boot Section CRC */
991
NVM_CMD_FLASH_RANGE_CRC_gc = (0x3A<<0), /* Generate Flash Range CRC */
994
/* SPM ready interrupt level */
995
typedef enum NVM_SPMLVL_enum
997
NVM_SPMLVL_OFF_gc = (0x00<<2), /* Interrupt disabled */
998
NVM_SPMLVL_LO_gc = (0x01<<2), /* Low level */
999
NVM_SPMLVL_MED_gc = (0x02<<2), /* Medium level */
1000
NVM_SPMLVL_HI_gc = (0x03<<2), /* High level */
1003
/* EEPROM ready interrupt level */
1004
typedef enum NVM_EELVL_enum
1006
NVM_EELVL_OFF_gc = (0x00<<0), /* Interrupt disabled */
1007
NVM_EELVL_LO_gc = (0x01<<0), /* Low level */
1008
NVM_EELVL_MED_gc = (0x02<<0), /* Medium level */
1009
NVM_EELVL_HI_gc = (0x03<<0), /* High level */
1012
/* Boot lock bits - boot setcion */
1013
typedef enum NVM_BLBB_enum
1015
NVM_BLBB_NOLOCK_gc = (0x03<<6), /* No locks */
1016
NVM_BLBB_WLOCK_gc = (0x02<<6), /* Write not allowed */
1017
NVM_BLBB_RLOCK_gc = (0x01<<6), /* Read not allowed */
1018
NVM_BLBB_RWLOCK_gc = (0x00<<6), /* Read and write not allowed */
1021
/* Boot lock bits - application section */
1022
typedef enum NVM_BLBA_enum
1024
NVM_BLBA_NOLOCK_gc = (0x03<<4), /* No locks */
1025
NVM_BLBA_WLOCK_gc = (0x02<<4), /* Write not allowed */
1026
NVM_BLBA_RLOCK_gc = (0x01<<4), /* Read not allowed */
1027
NVM_BLBA_RWLOCK_gc = (0x00<<4), /* Read and write not allowed */
1030
/* Boot lock bits - application table section */
1031
typedef enum NVM_BLBAT_enum
1033
NVM_BLBAT_NOLOCK_gc = (0x03<<2), /* No locks */
1034
NVM_BLBAT_WLOCK_gc = (0x02<<2), /* Write not allowed */
1035
NVM_BLBAT_RLOCK_gc = (0x01<<2), /* Read not allowed */
1036
NVM_BLBAT_RWLOCK_gc = (0x00<<2), /* Read and write not allowed */
1040
typedef enum NVM_LB_enum
1042
NVM_LB_NOLOCK_gc = (0x03<<0), /* No locks */
1043
NVM_LB_WLOCK_gc = (0x02<<0), /* Write not allowed */
1044
NVM_LB_RWLOCK_gc = (0x00<<0), /* Read and write not allowed */
1047
/* Boot Loader Section Reset Vector */
1048
typedef enum BOOTRST_enum
1050
BOOTRST_BOOTLDR_gc = (0x00<<6), /* Boot Loader Reset */
1051
BOOTRST_APPLICATION_gc = (0x01<<6), /* Application Reset */
1055
typedef enum BOD_enum
1057
BOD_INSAMPLEDMODE_gc = (0x01<<0), /* BOD enabled in sampled mode */
1058
BOD_CONTINOUSLY_gc = (0x02<<0), /* BOD enabled continuously */
1059
BOD_DISABLED_gc = (0x03<<0), /* BOD Disabled */
1062
/* Watchdog (Window) Timeout Period */
1063
typedef enum WD_enum
1065
WD_8CLK_gc = (0x00<<4), /* 8 cycles (8ms @ 3.3V) */
1066
WD_16CLK_gc = (0x01<<4), /* 16 cycles (16ms @ 3.3V) */
1067
WD_32CLK_gc = (0x02<<4), /* 32 cycles (32ms @ 3.3V) */
1068
WD_64CLK_gc = (0x03<<4), /* 64 cycles (64ms @ 3.3V) */
1069
WD_128CLK_gc = (0x04<<4), /* 128 cycles (0.125s @ 3.3V) */
1070
WD_256CLK_gc = (0x05<<4), /* 256 cycles (0.25s @ 3.3V) */
1071
WD_512CLK_gc = (0x06<<4), /* 512 cycles (0.5s @ 3.3V) */
1072
WD_1KCLK_gc = (0x07<<4), /* 1K cycles (1s @ 3.3V) */
1073
WD_2KCLK_gc = (0x08<<4), /* 2K cycles (2s @ 3.3V) */
1074
WD_4KCLK_gc = (0x09<<4), /* 4K cycles (4s @ 3.3V) */
1075
WD_8KCLK_gc = (0x0A<<4), /* 8K cycles (8s @ 3.3V) */
1079
typedef enum SUT_enum
1081
SUT_0MS_gc = (0x03<<2), /* 0 ms */
1082
SUT_4MS_gc = (0x01<<2), /* 4 ms */
1083
SUT_64MS_gc = (0x00<<2), /* 64 ms */
1086
/* Brown Out Detection Voltage Level */
1087
typedef enum BODLVL_enum
1089
BODLVL_1V6_gc = (0x07<<0), /* 1.6 V */
1090
BODLVL_1V9_gc = (0x06<<0), /* 1.8 V */
1091
BODLVL_2V1_gc = (0x05<<0), /* 2.0 V */
1092
BODLVL_2V4_gc = (0x04<<0), /* 2.2 V */
1093
BODLVL_2V6_gc = (0x03<<0), /* 2.4 V */
1094
BODLVL_2V9_gc = (0x02<<0), /* 2.7 V */
1095
BODLVL_3V2_gc = (0x01<<0), /* 2.9 V */
1100
--------------------------------------------------------------------------
1101
AC - Analog Comparator
1102
--------------------------------------------------------------------------
1105
/* Analog Comparator */
1106
typedef struct AC_struct
1108
register8_t AC0CTRL; /* Comparator 0 Control */
1109
register8_t AC1CTRL; /* Comparator 1 Control */
1110
register8_t AC0MUXCTRL; /* Comparator 0 MUX Control */
1111
register8_t AC1MUXCTRL; /* Comparator 1 MUX Control */
1112
register8_t CTRLA; /* Control Register A */
1113
register8_t CTRLB; /* Control Register B */
1114
register8_t WINCTRL; /* Window Mode Control */
1115
register8_t STATUS; /* Status */
1118
/* Interrupt mode */
1119
typedef enum AC_INTMODE_enum
1121
AC_INTMODE_BOTHEDGES_gc = (0x00<<6), /* Interrupt on both edges */
1122
AC_INTMODE_FALLING_gc = (0x02<<6), /* Interrupt on falling edge */
1123
AC_INTMODE_RISING_gc = (0x03<<6), /* Interrupt on rising edge */
1126
/* Interrupt level */
1127
typedef enum AC_INTLVL_enum
1129
AC_INTLVL_OFF_gc = (0x00<<4), /* Interrupt disabled */
1130
AC_INTLVL_LO_gc = (0x01<<4), /* Low level */
1131
AC_INTLVL_MED_gc = (0x02<<4), /* Medium level */
1132
AC_INTLVL_HI_gc = (0x03<<4), /* High level */
1135
/* Hysteresis mode selection */
1136
typedef enum AC_HYSMODE_enum
1138
AC_HYSMODE_NO_gc = (0x00<<1), /* No hysteresis */
1139
AC_HYSMODE_SMALL_gc = (0x01<<1), /* Small hysteresis */
1140
AC_HYSMODE_LARGE_gc = (0x02<<1), /* Large hysteresis */
1143
/* Positive input multiplexer selection */
1144
typedef enum AC_MUXPOS_enum
1146
AC_MUXPOS_PIN0_gc = (0x00<<3), /* Pin 0 */
1147
AC_MUXPOS_PIN1_gc = (0x01<<3), /* Pin 1 */
1148
AC_MUXPOS_PIN2_gc = (0x02<<3), /* Pin 2 */
1149
AC_MUXPOS_PIN3_gc = (0x03<<3), /* Pin 3 */
1150
AC_MUXPOS_PIN4_gc = (0x04<<3), /* Pin 4 */
1151
AC_MUXPOS_PIN5_gc = (0x05<<3), /* Pin 5 */
1152
AC_MUXPOS_PIN6_gc = (0x06<<3), /* Pin 6 */
1153
AC_MUXPOS_DAC_gc = (0x07<<3), /* DAC output */
1156
/* Negative input multiplexer selection */
1157
typedef enum AC_MUXNEG_enum
1159
AC_MUXNEG_PIN0_gc = (0x00<<0), /* Pin 0 */
1160
AC_MUXNEG_PIN1_gc = (0x01<<0), /* Pin 1 */
1161
AC_MUXNEG_PIN3_gc = (0x02<<0), /* Pin 3 */
1162
AC_MUXNEG_PIN5_gc = (0x03<<0), /* Pin 5 */
1163
AC_MUXNEG_PIN7_gc = (0x04<<0), /* Pin 7 */
1164
AC_MUXNEG_DAC_gc = (0x05<<0), /* DAC output */
1165
AC_MUXNEG_BANDGAP_gc = (0x06<<0), /* Bandgap Reference */
1166
AC_MUXNEG_SCALER_gc = (0x07<<0), /* Internal voltage scaler */
1169
/* Windows interrupt mode */
1170
typedef enum AC_WINTMODE_enum
1172
AC_WINTMODE_ABOVE_gc = (0x00<<2), /* Interrupt on above window */
1173
AC_WINTMODE_INSIDE_gc = (0x01<<2), /* Interrupt on inside window */
1174
AC_WINTMODE_BELOW_gc = (0x02<<2), /* Interrupt on below window */
1175
AC_WINTMODE_OUTSIDE_gc = (0x03<<2), /* Interrupt on outside window */
1178
/* Window interrupt level */
1179
typedef enum AC_WINTLVL_enum
1181
AC_WINTLVL_OFF_gc = (0x00<<0), /* Interrupt disabled */
1182
AC_WINTLVL_LO_gc = (0x01<<0), /* Low priority */
1183
AC_WINTLVL_MED_gc = (0x02<<0), /* Medium priority */
1184
AC_WINTLVL_HI_gc = (0x03<<0), /* High priority */
1187
/* Window mode state */
1188
typedef enum AC_WSTATE_enum
1190
AC_WSTATE_ABOVE_gc = (0x00<<6), /* Signal above window */
1191
AC_WSTATE_INSIDE_gc = (0x01<<6), /* Signal inside window */
1192
AC_WSTATE_BELOW_gc = (0x02<<6), /* Signal below window */
1197
--------------------------------------------------------------------------
1198
ADC - Analog/Digital Converter
1199
--------------------------------------------------------------------------
1203
typedef struct ADC_CH_struct
1205
register8_t CTRL; /* Control Register */
1206
register8_t MUXCTRL; /* MUX Control */
1207
register8_t INTCTRL; /* Channel Interrupt Control */
1208
register8_t INTFLAGS; /* Interrupt Flags */
1209
_WORDREGISTER(RES); /* Channel Result */
1210
register8_t reserved_0x6;
1211
register8_t reserved_0x7;
1215
--------------------------------------------------------------------------
1216
ADC - Analog/Digital Converter
1217
--------------------------------------------------------------------------
1220
/* Analog-to-Digital Converter */
1221
typedef struct ADC_struct
1223
register8_t CTRLA; /* Control Register A */
1224
register8_t CTRLB; /* Control Register B */
1225
register8_t REFCTRL; /* Reference Control */
1226
register8_t EVCTRL; /* Event Control */
1227
register8_t PRESCALER; /* Clock Prescaler */
1228
register8_t reserved_0x05;
1229
register8_t INTFLAGS; /* Interrupt Flags */
1230
register8_t reserved_0x07;
1231
register8_t reserved_0x08;
1232
register8_t reserved_0x09;
1233
register8_t reserved_0x0A;
1234
register8_t reserved_0x0B;
1235
_WORDREGISTER(CAL); /* Calibration Value */
1236
register8_t reserved_0x0E;
1237
register8_t reserved_0x0F;
1238
_WORDREGISTER(CH0RES); /* Channel 0 Result */
1239
_WORDREGISTER(CH1RES); /* Channel 1 Result */
1240
_WORDREGISTER(CH2RES); /* Channel 2 Result */
1241
_WORDREGISTER(CH3RES); /* Channel 3 Result */
1242
_WORDREGISTER(CMP); /* Compare Value */
1243
register8_t reserved_0x1A;
1244
register8_t reserved_0x1B;
1245
register8_t reserved_0x1C;
1246
register8_t reserved_0x1D;
1247
register8_t reserved_0x1E;
1248
register8_t reserved_0x1F;
1249
ADC_CH_t CH0; /* ADC Channel 0 */
1250
ADC_CH_t CH1; /* ADC Channel 1 */
1251
ADC_CH_t CH2; /* ADC Channel 2 */
1252
ADC_CH_t CH3; /* ADC Channel 3 */
1255
/* Positive input multiplexer selection */
1256
typedef enum ADC_CH_MUXPOS_enum
1258
ADC_CH_MUXPOS_PIN0_gc = (0x00<<3), /* Input pin 0 */
1259
ADC_CH_MUXPOS_PIN1_gc = (0x01<<3), /* Input pin 1 */
1260
ADC_CH_MUXPOS_PIN2_gc = (0x02<<3), /* Input pin 2 */
1261
ADC_CH_MUXPOS_PIN3_gc = (0x03<<3), /* Input pin 3 */
1262
ADC_CH_MUXPOS_PIN4_gc = (0x04<<3), /* Input pin 4 */
1263
ADC_CH_MUXPOS_PIN5_gc = (0x05<<3), /* Input pin 5 */
1264
ADC_CH_MUXPOS_PIN6_gc = (0x06<<3), /* Input pin 6 */
1265
ADC_CH_MUXPOS_PIN7_gc = (0x07<<3), /* Input pin 7 */
1268
/* Internal input multiplexer selections */
1269
typedef enum ADC_CH_MUXINT_enum
1271
ADC_CH_MUXINT_TEMP_gc = (0x00<<3), /* Temperature Reference */
1272
ADC_CH_MUXINT_BANDGAP_gc = (0x01<<3), /* Bandgap Reference */
1273
ADC_CH_MUXINT_SCALEDVCC_gc = (0x02<<3), /* 1/10 scaled VCC */
1274
ADC_CH_MUXINT_DAC_gc = (0x03<<3), /* DAC output */
1277
/* Negative input multiplexer selection */
1278
typedef enum ADC_CH_MUXNEG_enum
1280
ADC_CH_MUXNEG_PIN0_gc = (0x00<<0), /* Input pin 0 */
1281
ADC_CH_MUXNEG_PIN1_gc = (0x01<<0), /* Input pin 1 */
1282
ADC_CH_MUXNEG_PIN2_gc = (0x02<<0), /* Input pin 2 */
1283
ADC_CH_MUXNEG_PIN3_gc = (0x03<<0), /* Input pin 3 */
1284
ADC_CH_MUXNEG_PIN4_gc = (0x04<<0), /* Input pin 4 */
1285
ADC_CH_MUXNEG_PIN5_gc = (0x05<<0), /* Input pin 5 */
1286
ADC_CH_MUXNEG_PIN6_gc = (0x06<<0), /* Input pin 6 */
1287
ADC_CH_MUXNEG_PIN7_gc = (0x07<<0), /* Input pin 7 */
1291
typedef enum ADC_CH_INPUTMODE_enum
1293
ADC_CH_INPUTMODE_INTERNAL_gc = (0x00<<0), /* Internal inputs, no gain */
1294
ADC_CH_INPUTMODE_SINGLEENDED_gc = (0x01<<0), /* Single-ended input, no gain */
1295
ADC_CH_INPUTMODE_DIFF_gc = (0x02<<0), /* Differential input, no gain */
1296
ADC_CH_INPUTMODE_DIFFWGAIN_gc = (0x03<<0), /* Differential input, with gain */
1297
} ADC_CH_INPUTMODE_t;
1300
typedef enum ADC_CH_GAIN_enum
1302
ADC_CH_GAIN_1X_gc = (0x00<<2), /* 1x gain */
1303
ADC_CH_GAIN_2X_gc = (0x01<<2), /* 2x gain */
1304
ADC_CH_GAIN_4X_gc = (0x02<<2), /* 4x gain */
1305
ADC_CH_GAIN_8X_gc = (0x03<<2), /* 8x gain */
1306
ADC_CH_GAIN_16X_gc = (0x04<<2), /* 16x gain */
1307
ADC_CH_GAIN_32X_gc = (0x05<<2), /* 32x gain */
1308
ADC_CH_GAIN_64X_gc = (0x06<<2), /* 64x gain */
1311
/* Conversion result resolution */
1312
typedef enum ADC_RESOLUTION_enum
1314
ADC_RESOLUTION_12BIT_gc = (0x00<<1), /* 12-bit right-adjusted result */
1315
ADC_RESOLUTION_8BIT_gc = (0x02<<1), /* 8-bit right-adjusted result */
1316
ADC_RESOLUTION_LEFT12BIT_gc = (0x03<<1), /* 12-bit left-adjusted result */
1319
/* Voltage reference selection */
1320
typedef enum ADC_REFSEL_enum
1322
ADC_REFSEL_INT1V_gc = (0x00<<4), /* Internal 1V */
1323
ADC_REFSEL_VCC_gc = (0x01<<4), /* Internal VCC / 1.6V */
1324
ADC_REFSEL_AREFA_gc = (0x02<<4), /* External reference on PORT A */
1325
ADC_REFSEL_AREFB_gc = (0x03<<4), /* External reference on PORT B */
1328
/* Channel sweep selection */
1329
typedef enum ADC_SWEEP_enum
1331
ADC_SWEEP_0_gc = (0x00<<6), /* ADC Channel 0 */
1332
ADC_SWEEP_01_gc = (0x01<<6), /* ADC Channel 0,1 */
1333
ADC_SWEEP_012_gc = (0x02<<6), /* ADC Channel 0,1,2 */
1334
ADC_SWEEP_0123_gc = (0x03<<6), /* ADC Channel 0,1,2,3 */
1337
/* Event channel input selection */
1338
typedef enum ADC_EVSEL_enum
1340
ADC_EVSEL_0123_gc = (0x00<<3), /* Event Channel 0,1,2,3 */
1341
ADC_EVSEL_1234_gc = (0x01<<3), /* Event Channel 1,2,3,4 */
1342
ADC_EVSEL_2345_gc = (0x02<<3), /* Event Channel 2,3,4,5 */
1343
ADC_EVSEL_3456_gc = (0x03<<3), /* Event Channel 3,4,5,6 */
1344
ADC_EVSEL_4567_gc = (0x04<<3), /* Event Channel 4,5,6,7 */
1345
ADC_EVSEL_567_gc = (0x05<<3), /* Event Channel 5,6,7 */
1346
ADC_EVSEL_67_gc = (0x06<<3), /* Event Channel 6,7 */
1347
ADC_EVSEL_7_gc = (0x07<<3), /* Event Channel 7 */
1350
/* Event action selection */
1351
typedef enum ADC_EVACT_enum
1353
ADC_EVACT_NONE_gc = (0x00<<0), /* No event action */
1354
ADC_EVACT_CH0_gc = (0x01<<0), /* First event triggers channel 0 */
1355
ADC_EVACT_CH01_gc = (0x02<<0), /* First two events trigger channel 0,1 */
1356
ADC_EVACT_CH012_gc = (0x03<<0), /* First three events trigger channel 0,1,2 */
1357
ADC_EVACT_CH0123_gc = (0x04<<0), /* Events trigger channel 0,1,2,3 */
1358
ADC_EVACT_SWEEP_gc = (0x05<<0), /* First event triggers sweep */
1359
ADC_EVACT_SYNCHSWEEP_gc = (0x06<<0), /* First event triggers synchronized sweep */
1363
typedef enum ADC_CH_INTMODE_enum
1365
ADC_CH_INTMODE_COMPLETE_gc = (0x00<<2), /* Interrupt on conversion complete */
1366
ADC_CH_INTMODE_BELOW_gc = (0x01<<2), /* Interrupt on result below compare value */
1367
ADC_CH_INTMODE_ABOVE_gc = (0x03<<2), /* Interrupt on result above compare value */
1370
/* Interrupt level */
1371
typedef enum ADC_CH_INTLVL_enum
1373
ADC_CH_INTLVL_OFF_gc = (0x00<<0), /* Interrupt disabled */
1374
ADC_CH_INTLVL_LO_gc = (0x01<<0), /* Low level */
1375
ADC_CH_INTLVL_MED_gc = (0x02<<0), /* Medium level */
1376
ADC_CH_INTLVL_HI_gc = (0x03<<0), /* High level */
1379
/* DMA request selection */
1380
typedef enum ADC_DMASEL_enum
1382
ADC_DMASEL_OFF_gc = (0x00<<6), /* Combined DMA request OFF */
1383
ADC_DMASEL_CH01_gc = (0x01<<6), /* ADC Channel 0 or 1 */
1384
ADC_DMASEL_CH012_gc = (0x02<<6), /* ADC Channel 0 or 1 or 2 */
1385
ADC_DMASEL_CH0123_gc = (0x03<<6), /* ADC Channel 0 or 1 or 2 or 3 */
1388
/* Clock prescaler */
1389
typedef enum ADC_PRESCALER_enum
1391
ADC_PRESCALER_DIV4_gc = (0x00<<0), /* Divide clock by 4 */
1392
ADC_PRESCALER_DIV8_gc = (0x01<<0), /* Divide clock by 8 */
1393
ADC_PRESCALER_DIV16_gc = (0x02<<0), /* Divide clock by 16 */
1394
ADC_PRESCALER_DIV32_gc = (0x03<<0), /* Divide clock by 32 */
1395
ADC_PRESCALER_DIV64_gc = (0x04<<0), /* Divide clock by 64 */
1396
ADC_PRESCALER_DIV128_gc = (0x05<<0), /* Divide clock by 128 */
1397
ADC_PRESCALER_DIV256_gc = (0x06<<0), /* Divide clock by 256 */
1398
ADC_PRESCALER_DIV512_gc = (0x07<<0), /* Divide clock by 512 */
1403
--------------------------------------------------------------------------
1404
DAC - Digital/Analog Converter
1405
--------------------------------------------------------------------------
1408
/* Digital-to-Analog Converter */
1409
typedef struct DAC_struct
1411
register8_t CTRLA; /* Control Register A */
1412
register8_t CTRLB; /* Control Register B */
1413
register8_t CTRLC; /* Control Register C */
1414
register8_t EVCTRL; /* Event Input Control */
1415
register8_t TIMCTRL; /* Timing Control */
1416
register8_t STATUS; /* Status */
1417
register8_t reserved_0x06;
1418
register8_t reserved_0x07;
1419
register8_t GAINCAL; /* Gain Calibration */
1420
register8_t OFFSETCAL; /* Offset Calibration */
1421
register8_t reserved_0x0A;
1422
register8_t reserved_0x0B;
1423
register8_t reserved_0x0C;
1424
register8_t reserved_0x0D;
1425
register8_t reserved_0x0E;
1426
register8_t reserved_0x0F;
1427
register8_t reserved_0x10;
1428
register8_t reserved_0x11;
1429
register8_t reserved_0x12;
1430
register8_t reserved_0x13;
1431
register8_t reserved_0x14;
1432
register8_t reserved_0x15;
1433
register8_t reserved_0x16;
1434
register8_t reserved_0x17;
1435
_WORDREGISTER(CH0DATA); /* Channel 0 Data */
1436
_WORDREGISTER(CH1DATA); /* Channel 1 Data */
1439
/* Output channel selection */
1440
typedef enum DAC_CHSEL_enum
1442
DAC_CHSEL_SINGLE_gc = (0x00<<5), /* Single channel operation (Channel A only) */
1443
DAC_CHSEL_DUAL_gc = (0x02<<5), /* Dual channel operation (S/H on both channels) */
1446
/* Reference voltage selection */
1447
typedef enum DAC_REFSEL_enum
1449
DAC_REFSEL_INT1V_gc = (0x00<<3), /* Internal 1V */
1450
DAC_REFSEL_AVCC_gc = (0x01<<3), /* Analog supply voltage */
1451
DAC_REFSEL_AREFA_gc = (0x02<<3), /* External reference on AREF on PORTA */
1452
DAC_REFSEL_AREFB_gc = (0x03<<3), /* External reference on AREF on PORTB */
1455
/* Event channel selection */
1456
typedef enum DAC_EVSEL_enum
1458
DAC_EVSEL_0_gc = (0x00<<0), /* Event Channel 0 */
1459
DAC_EVSEL_1_gc = (0x01<<0), /* Event Channel 1 */
1460
DAC_EVSEL_2_gc = (0x02<<0), /* Event Channel 2 */
1461
DAC_EVSEL_3_gc = (0x03<<0), /* Event Channel 3 */
1462
DAC_EVSEL_4_gc = (0x04<<0), /* Event Channel 4 */
1463
DAC_EVSEL_5_gc = (0x05<<0), /* Event Channel 5 */
1464
DAC_EVSEL_6_gc = (0x06<<0), /* Event Channel 6 */
1465
DAC_EVSEL_7_gc = (0x07<<0), /* Event Channel 7 */
1468
/* Conversion interval */
1469
typedef enum DAC_CONINTVAL_enum
1471
DAC_CONINTVAL_1CLK_gc = (0x00<<4), /* 1 CLK / 2 CLK in S/H mode */
1472
DAC_CONINTVAL_2CLK_gc = (0x01<<4), /* 2 CLK / 3 CLK in S/H mode */
1473
DAC_CONINTVAL_4CLK_gc = (0x02<<4), /* 4 CLK / 6 CLK in S/H mode */
1474
DAC_CONINTVAL_8CLK_gc = (0x03<<4), /* 8 CLK / 12 CLK in S/H mode */
1475
DAC_CONINTVAL_16CLK_gc = (0x04<<4), /* 16 CLK / 24 CLK in S/H mode */
1476
DAC_CONINTVAL_32CLK_gc = (0x05<<4), /* 32 CLK / 48 CLK in S/H mode */
1477
DAC_CONINTVAL_64CLK_gc = (0x06<<4), /* 64 CLK / 96 CLK in S/H mode */
1478
DAC_CONINTVAL_128CLK_gc = (0x07<<4), /* 128 CLK / 192 CLK in S/H mode */
1482
typedef enum DAC_REFRESH_enum
1484
DAC_REFRESH_16CLK_gc = (0x00<<0), /* 16 CLK */
1485
DAC_REFRESH_32CLK_gc = (0x01<<0), /* 32 CLK */
1486
DAC_REFRESH_64CLK_gc = (0x02<<0), /* 64 CLK */
1487
DAC_REFRESH_128CLK_gc = (0x03<<0), /* 128 CLK */
1488
DAC_REFRESH_256CLK_gc = (0x04<<0), /* 256 CLK */
1489
DAC_REFRESH_512CLK_gc = (0x05<<0), /* 512 CLK */
1490
DAC_REFRESH_1024CLK_gc = (0x06<<0), /* 1024 CLK */
1491
DAC_REFRESH_2048CLK_gc = (0x07<<0), /* 2048 CLK */
1492
DAC_REFRESH_4096CLK_gc = (0x08<<0), /* 4096 CLK */
1493
DAC_REFRESH_8192CLK_gc = (0x09<<0), /* 8192 CLK */
1494
DAC_REFRESH_16384CLK_gc = (0x0A<<0), /* 16384 CLK */
1495
DAC_REFRESH_32768CLK_gc = (0x0B<<0), /* 32768 CLK */
1496
DAC_REFRESH_65536CLK_gc = (0x0C<<0), /* 65536 CLK */
1497
DAC_REFRESH_OFF_gc = (0x0F<<0), /* Auto refresh OFF */
1502
--------------------------------------------------------------------------
1503
RTC - Real-Time Clounter
1504
--------------------------------------------------------------------------
1507
/* Real-Time Counter */
1508
typedef struct RTC_struct
1510
register8_t CTRL; /* Control Register */
1511
register8_t STATUS; /* Status Register */
1512
register8_t INTCTRL; /* Interrupt Control Register */
1513
register8_t INTFLAGS; /* Interrupt Flags */
1514
register8_t TEMP; /* Temporary register */
1515
register8_t reserved_0x05;
1516
register8_t reserved_0x06;
1517
register8_t reserved_0x07;
1518
_WORDREGISTER(CNT); /* Count Register */
1519
_WORDREGISTER(PER); /* Period Register */
1520
_WORDREGISTER(COMP); /* Compare Register */
1523
/* Prescaler Factor */
1524
typedef enum RTC_PRESCALER_enum
1526
RTC_PRESCALER_OFF_gc = (0x00<<0), /* RTC Off */
1527
RTC_PRESCALER_DIV1_gc = (0x01<<0), /* RTC Clock */
1528
RTC_PRESCALER_DIV2_gc = (0x02<<0), /* RTC Clock / 2 */
1529
RTC_PRESCALER_DIV8_gc = (0x03<<0), /* RTC Clock / 8 */
1530
RTC_PRESCALER_DIV16_gc = (0x04<<0), /* RTC Clock / 16 */
1531
RTC_PRESCALER_DIV64_gc = (0x05<<0), /* RTC Clock / 64 */
1532
RTC_PRESCALER_DIV256_gc = (0x06<<0), /* RTC Clock / 256 */
1533
RTC_PRESCALER_DIV1024_gc = (0x07<<0), /* RTC Clock / 1024 */
1536
/* Compare Interrupt level */
1537
typedef enum RTC_COMPINTLVL_enum
1539
RTC_COMPINTLVL_OFF_gc = (0x00<<2), /* Interrupt Disabled */
1540
RTC_COMPINTLVL_LO_gc = (0x01<<2), /* Low Level */
1541
RTC_COMPINTLVL_MED_gc = (0x02<<2), /* Medium Level */
1542
RTC_COMPINTLVL_HI_gc = (0x03<<2), /* High Level */
1545
/* Overflow Interrupt level */
1546
typedef enum RTC_OVFINTLVL_enum
1548
RTC_OVFINTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
1549
RTC_OVFINTLVL_LO_gc = (0x01<<0), /* Low Level */
1550
RTC_OVFINTLVL_MED_gc = (0x02<<0), /* Medium Level */
1551
RTC_OVFINTLVL_HI_gc = (0x03<<0), /* High Level */
1556
--------------------------------------------------------------------------
1557
EBI - External Bus Interface
1558
--------------------------------------------------------------------------
1561
/* EBI Chip Select Module */
1562
typedef struct EBI_CS_struct
1564
register8_t CTRLA; /* Chip Select Control Register A */
1565
register8_t CTRLB; /* Chip Select Control Register B */
1566
_WORDREGISTER(BASEADDR); /* Chip Select Base Address */
1570
--------------------------------------------------------------------------
1571
EBI - External Bus Interface
1572
--------------------------------------------------------------------------
1575
/* External Bus Interface */
1576
typedef struct EBI_struct
1578
register8_t CTRL; /* Control */
1579
register8_t SDRAMCTRLA; /* SDRAM Control Register A */
1580
register8_t reserved_0x02;
1581
register8_t reserved_0x03;
1582
_WORDREGISTER(REFRESH); /* SDRAM Refresh Period */
1583
_WORDREGISTER(INITDLY); /* SDRAM Initialization Delay */
1584
register8_t SDRAMCTRLB; /* SDRAM Control Register B */
1585
register8_t SDRAMCTRLC; /* SDRAM Control Register C */
1586
register8_t reserved_0x0A;
1587
register8_t reserved_0x0B;
1588
register8_t reserved_0x0C;
1589
register8_t reserved_0x0D;
1590
register8_t reserved_0x0E;
1591
register8_t reserved_0x0F;
1592
EBI_CS_t CS0; /* Chip Select 0 */
1593
EBI_CS_t CS1; /* Chip Select 1 */
1594
EBI_CS_t CS2; /* Chip Select 2 */
1595
EBI_CS_t CS3; /* Chip Select 3 */
1598
/* Chip Select adress space */
1599
typedef enum EBI_CS_ASIZE_enum
1601
EBI_CS_ASIZE_256B_gc = (0x00<<2), /* 256 bytes */
1602
EBI_CS_ASIZE_512B_gc = (0x01<<2), /* 512 bytes */
1603
EBI_CS_ASIZE_1KB_gc = (0x02<<2), /* 1K bytes */
1604
EBI_CS_ASIZE_2KB_gc = (0x03<<2), /* 2K bytes */
1605
EBI_CS_ASIZE_4KB_gc = (0x04<<2), /* 4K bytes */
1606
EBI_CS_ASIZE_8KB_gc = (0x05<<2), /* 8K bytes */
1607
EBI_CS_ASIZE_16KB_gc = (0x06<<2), /* 16K bytes */
1608
EBI_CS_ASIZE_32KB_gc = (0x07<<2), /* 32K bytes */
1609
EBI_CS_ASIZE_64KB_gc = (0x08<<2), /* 64K bytes */
1610
EBI_CS_ASIZE_128KB_gc = (0x09<<2), /* 128K bytes */
1611
EBI_CS_ASIZE_256KB_gc = (0x0A<<2), /* 256K bytes */
1612
EBI_CS_ASIZE_512KB_gc = (0x0B<<2), /* 512K bytes */
1613
EBI_CS_ASIZE_1MB_gc = (0x0C<<2), /* 1M bytes */
1614
EBI_CS_ASIZE_2MB_gc = (0x0D<<2), /* 2M bytes */
1615
EBI_CS_ASIZE_4MB_gc = (0x0E<<2), /* 4M bytes */
1616
EBI_CS_ASIZE_8MB_gc = (0x0F<<2), /* 8M bytes */
1617
EBI_CS_ASIZE_16M_gc = (0x10<<2), /* 16M bytes */
1621
typedef enum EBI_CS_SRWS_enum
1623
EBI_CS_SRWS_0CLK_gc = (0x00<<0), /* 0 cycles */
1624
EBI_CS_SRWS_1CLK_gc = (0x01<<0), /* 1 cycle */
1625
EBI_CS_SRWS_2CLK_gc = (0x02<<0), /* 2 cycles */
1626
EBI_CS_SRWS_3CLK_gc = (0x03<<0), /* 3 cycles */
1627
EBI_CS_SRWS_4CLK_gc = (0x04<<0), /* 4 cycles */
1628
EBI_CS_SRWS_5CLK_gc = (0x05<<0), /* 5 cycle */
1629
EBI_CS_SRWS_6CLK_gc = (0x06<<0), /* 6 cycles */
1630
EBI_CS_SRWS_7CLK_gc = (0x07<<0), /* 7 cycles */
1633
/* Chip Select address mode */
1634
typedef enum EBI_CS_MODE_enum
1636
EBI_CS_MODE_DISABLED_gc = (0x00<<0), /* Chip Select Disabled */
1637
EBI_CS_MODE_SRAM_gc = (0x01<<0), /* Chip Select in SRAM mode */
1638
EBI_CS_MODE_LPC_gc = (0x02<<0), /* Chip Select in SRAM LPC mode */
1639
EBI_CS_MODE_SDRAM_gc = (0x03<<0), /* Chip Select in SDRAM mode */
1642
/* Chip Select SDRAM mode */
1643
typedef enum EBI_CS_SDMODE_enum
1645
EBI_CS_SDMODE_NORMAL_gc = (0x00<<0), /* Normal mode */
1646
EBI_CS_SDMODE_LOAD_gc = (0x01<<0), /* Load Mode Register command mode */
1650
typedef enum EBI_SDDATAW_enum
1652
EBI_SDDATAW_4BIT_gc = (0x00<<6), /* 4-bit data bus */
1653
EBI_SDDATAW_8BIT_gc = (0x01<<6), /* 8-bit data bus */
1657
typedef enum EBI_LPCMODE_enum
1659
EBI_LPCMODE_ALE1_gc = (0x00<<4), /* Data muxed with addr byte 0 */
1660
EBI_LPCMODE_ALE12_gc = (0x02<<4), /* Data muxed with addr byte 0 and 1 */
1664
typedef enum EBI_SRMODE_enum
1666
EBI_SRMODE_ALE1_gc = (0x00<<2), /* Addr byte 0 muxed with 1 */
1667
EBI_SRMODE_ALE2_gc = (0x01<<2), /* Addr byte 0 muxed with 2 */
1668
EBI_SRMODE_ALE12_gc = (0x02<<2), /* Addr byte 0 muxed with 1 and 2 */
1669
EBI_SRMODE_NOALE_gc = (0x03<<2), /* No addr muxing */
1673
typedef enum EBI_IFMODE_enum
1675
EBI_IFMODE_DISABLED_gc = (0x00<<0), /* EBI Disabled */
1676
EBI_IFMODE_3PORT_gc = (0x01<<0), /* 3-port mode */
1677
EBI_IFMODE_4PORT_gc = (0x02<<0), /* 4-port mode */
1678
EBI_IFMODE_2PORT_gc = (0x03<<0), /* 2-port mode */
1682
typedef enum EBI_SDCOL_enum
1684
EBI_SDCOL_8BIT_gc = (0x00<<0), /* 8 column bits */
1685
EBI_SDCOL_9BIT_gc = (0x01<<0), /* 9 column bits */
1686
EBI_SDCOL_10BIT_gc = (0x02<<0), /* 10 column bits */
1687
EBI_SDCOL_11BIT_gc = (0x03<<0), /* 11 column bits */
1691
typedef enum EBI_MRDLY_enum
1693
EBI_MRDLY_0CLK_gc = (0x00<<6), /* 0 cycles */
1694
EBI_MRDLY_1CLK_gc = (0x01<<6), /* 1 cycle */
1695
EBI_MRDLY_2CLK_gc = (0x02<<6), /* 2 cycles */
1696
EBI_MRDLY_3CLK_gc = (0x03<<6), /* 3 cycles */
1700
typedef enum EBI_ROWCYCDLY_enum
1702
EBI_ROWCYCDLY_0CLK_gc = (0x00<<3), /* 0 cycles */
1703
EBI_ROWCYCDLY_1CLK_gc = (0x01<<3), /* 1 cycle */
1704
EBI_ROWCYCDLY_2CLK_gc = (0x02<<3), /* 2 cycles */
1705
EBI_ROWCYCDLY_3CLK_gc = (0x03<<3), /* 3 cycles */
1706
EBI_ROWCYCDLY_4CLK_gc = (0x04<<3), /* 4 cycles */
1707
EBI_ROWCYCDLY_5CLK_gc = (0x05<<3), /* 5 cycle */
1708
EBI_ROWCYCDLY_6CLK_gc = (0x06<<3), /* 6 cycles */
1709
EBI_ROWCYCDLY_7CLK_gc = (0x07<<3), /* 7 cycles */
1713
typedef enum EBI_RPDLY_enum
1715
EBI_RPDLY_0CLK_gc = (0x00<<0), /* 0 cycles */
1716
EBI_RPDLY_1CLK_gc = (0x01<<0), /* 1 cycle */
1717
EBI_RPDLY_2CLK_gc = (0x02<<0), /* 2 cycles */
1718
EBI_RPDLY_3CLK_gc = (0x03<<0), /* 3 cycles */
1719
EBI_RPDLY_4CLK_gc = (0x04<<0), /* 4 cycles */
1720
EBI_RPDLY_5CLK_gc = (0x05<<0), /* 5 cycle */
1721
EBI_RPDLY_6CLK_gc = (0x06<<0), /* 6 cycles */
1722
EBI_RPDLY_7CLK_gc = (0x07<<0), /* 7 cycles */
1726
typedef enum EBI_WRDLY_enum
1728
EBI_WRDLY_0CLK_gc = (0x00<<6), /* 0 cycles */
1729
EBI_WRDLY_1CLK_gc = (0x01<<6), /* 1 cycle */
1730
EBI_WRDLY_2CLK_gc = (0x02<<6), /* 2 cycles */
1731
EBI_WRDLY_3CLK_gc = (0x03<<6), /* 3 cycles */
1735
typedef enum EBI_ESRDLY_enum
1737
EBI_ESRDLY_0CLK_gc = (0x00<<3), /* 0 cycles */
1738
EBI_ESRDLY_1CLK_gc = (0x01<<3), /* 1 cycle */
1739
EBI_ESRDLY_2CLK_gc = (0x02<<3), /* 2 cycles */
1740
EBI_ESRDLY_3CLK_gc = (0x03<<3), /* 3 cycles */
1741
EBI_ESRDLY_4CLK_gc = (0x04<<3), /* 4 cycles */
1742
EBI_ESRDLY_5CLK_gc = (0x05<<3), /* 5 cycle */
1743
EBI_ESRDLY_6CLK_gc = (0x06<<3), /* 6 cycles */
1744
EBI_ESRDLY_7CLK_gc = (0x07<<3), /* 7 cycles */
1748
typedef enum EBI_ROWCOLDLY_enum
1750
EBI_ROWCOLDLY_0CLK_gc = (0x00<<0), /* 0 cycles */
1751
EBI_ROWCOLDLY_1CLK_gc = (0x01<<0), /* 1 cycle */
1752
EBI_ROWCOLDLY_2CLK_gc = (0x02<<0), /* 2 cycles */
1753
EBI_ROWCOLDLY_3CLK_gc = (0x03<<0), /* 3 cycles */
1754
EBI_ROWCOLDLY_4CLK_gc = (0x04<<0), /* 4 cycles */
1755
EBI_ROWCOLDLY_5CLK_gc = (0x05<<0), /* 5 cycle */
1756
EBI_ROWCOLDLY_6CLK_gc = (0x06<<0), /* 6 cycles */
1757
EBI_ROWCOLDLY_7CLK_gc = (0x07<<0), /* 7 cycles */
1762
--------------------------------------------------------------------------
1763
TWI - Two-Wire Interface
1764
--------------------------------------------------------------------------
1768
typedef struct TWI_MASTER_struct
1770
register8_t CTRLA; /* Control Register A */
1771
register8_t CTRLB; /* Control Register B */
1772
register8_t CTRLC; /* Control Register C */
1773
register8_t STATUS; /* Status Register */
1774
register8_t BAUD; /* Baurd Rate Control Register */
1775
register8_t ADDR; /* Address Register */
1776
register8_t DATA; /* Data Register */
1780
--------------------------------------------------------------------------
1781
TWI - Two-Wire Interface
1782
--------------------------------------------------------------------------
1786
typedef struct TWI_SLAVE_struct
1788
register8_t CTRLA; /* Control Register A */
1789
register8_t CTRLB; /* Control Register B */
1790
register8_t STATUS; /* Status Register */
1791
register8_t ADDR; /* Address Register */
1792
register8_t DATA; /* Data Register */
1793
register8_t ADDRMASK; /* Address Mask Register */
1797
--------------------------------------------------------------------------
1798
TWI - Two-Wire Interface
1799
--------------------------------------------------------------------------
1802
/* Two-Wire Interface */
1803
typedef struct TWI_struct
1805
register8_t CTRL; /* TWI Common Control Register */
1806
TWI_MASTER_t MASTER; /* TWI master module */
1807
TWI_SLAVE_t SLAVE; /* TWI slave module */
1810
/* Master Interrupt Level */
1811
typedef enum TWI_MASTER_INTLVL_enum
1813
TWI_MASTER_INTLVL_OFF_gc = (0x00<<6), /* Interrupt Disabled */
1814
TWI_MASTER_INTLVL_LO_gc = (0x01<<6), /* Low Level */
1815
TWI_MASTER_INTLVL_MED_gc = (0x02<<6), /* Medium Level */
1816
TWI_MASTER_INTLVL_HI_gc = (0x03<<6), /* High Level */
1817
} TWI_MASTER_INTLVL_t;
1819
/* Inactive Timeout */
1820
typedef enum TWI_MASTER_TIMEOUT_enum
1822
TWI_MASTER_TIMEOUT_DISABLED_gc = (0x00<<2), /* Bus Timeout Disabled */
1823
TWI_MASTER_TIMEOUT_50US_gc = (0x01<<2), /* 50 Microseconds */
1824
TWI_MASTER_TIMEOUT_100US_gc = (0x02<<2), /* 100 Microseconds */
1825
TWI_MASTER_TIMEOUT_200US_gc = (0x03<<2), /* 200 Microseconds */
1826
} TWI_MASTER_TIMEOUT_t;
1828
/* Master Command */
1829
typedef enum TWI_MASTER_CMD_enum
1831
TWI_MASTER_CMD_NOACT_gc = (0x00<<0), /* No Action */
1832
TWI_MASTER_CMD_REPSTART_gc = (0x01<<0), /* Issue Repeated Start Condition */
1833
TWI_MASTER_CMD_RECVTRANS_gc = (0x02<<0), /* Receive or Transmit Data */
1834
TWI_MASTER_CMD_STOP_gc = (0x03<<0), /* Issue Stop Condition */
1837
/* Master Bus State */
1838
typedef enum TWI_MASTER_BUSSTATE_enum
1840
TWI_MASTER_BUSSTATE_UNKNOWN_gc = (0x00<<0), /* Unknown Bus State */
1841
TWI_MASTER_BUSSTATE_IDLE_gc = (0x01<<0), /* Bus is Idle */
1842
TWI_MASTER_BUSSTATE_OWNER_gc = (0x02<<0), /* This Module Controls The Bus */
1843
TWI_MASTER_BUSSTATE_BUSY_gc = (0x03<<0), /* The Bus is Busy */
1844
} TWI_MASTER_BUSSTATE_t;
1846
/* Slave Interrupt Level */
1847
typedef enum TWI_SLAVE_INTLVL_enum
1849
TWI_SLAVE_INTLVL_OFF_gc = (0x00<<6), /* Interrupt Disabled */
1850
TWI_SLAVE_INTLVL_LO_gc = (0x01<<6), /* Low Level */
1851
TWI_SLAVE_INTLVL_MED_gc = (0x02<<6), /* Medium Level */
1852
TWI_SLAVE_INTLVL_HI_gc = (0x03<<6), /* High Level */
1853
} TWI_SLAVE_INTLVL_t;
1856
typedef enum TWI_SLAVE_CMD_enum
1858
TWI_SLAVE_CMD_NOACT_gc = (0x00<<0), /* No Action */
1859
TWI_SLAVE_CMD_COMPTRANS_gc = (0x02<<0), /* Used To Complete a Transaction */
1860
TWI_SLAVE_CMD_RESPONSE_gc = (0x03<<0), /* Used in Response to Address/Data Interrupt */
1865
--------------------------------------------------------------------------
1866
PORT - Port Configuration
1867
--------------------------------------------------------------------------
1870
/* I/O port Configuration */
1871
typedef struct PORTCFG_struct
1873
register8_t MPCMASK; /* Multi-pin Configuration Mask */
1874
register8_t reserved_0x01;
1875
register8_t VPCTRLA; /* Virtual Port Control Register A */
1876
register8_t VPCTRLB; /* Virtual Port Control Register B */
1877
register8_t CLKEVOUT; /* Clock and Event Out Register */
1881
--------------------------------------------------------------------------
1882
PORT - Port Configuration
1883
--------------------------------------------------------------------------
1887
typedef struct VPORT_struct
1889
register8_t DIR; /* I/O Port Data Direction */
1890
register8_t OUT; /* I/O Port Output */
1891
register8_t IN; /* I/O Port Input */
1892
register8_t INTFLAGS; /* Interrupt Flag Register */
1896
--------------------------------------------------------------------------
1897
PORT - Port Configuration
1898
--------------------------------------------------------------------------
1902
typedef struct PORT_struct
1904
register8_t DIR; /* I/O Port Data Direction */
1905
register8_t DIRSET; /* I/O Port Data Direction Set */
1906
register8_t DIRCLR; /* I/O Port Data Direction Clear */
1907
register8_t DIRTGL; /* I/O Port Data Direction Toggle */
1908
register8_t OUT; /* I/O Port Output */
1909
register8_t OUTSET; /* I/O Port Output Set */
1910
register8_t OUTCLR; /* I/O Port Output Clear */
1911
register8_t OUTTGL; /* I/O Port Output Toggle */
1912
register8_t IN; /* I/O port Input */
1913
register8_t INTCTRL; /* Interrupt Control Register */
1914
register8_t INT0MASK; /* Port Interrupt 0 Mask */
1915
register8_t INT1MASK; /* Port Interrupt 1 Mask */
1916
register8_t INTFLAGS; /* Interrupt Flag Register */
1917
register8_t reserved_0x0D;
1918
register8_t reserved_0x0E;
1919
register8_t reserved_0x0F;
1920
register8_t PIN0CTRL; /* Pin 0 Control Register */
1921
register8_t PIN1CTRL; /* Pin 1 Control Register */
1922
register8_t PIN2CTRL; /* Pin 2 Control Register */
1923
register8_t PIN3CTRL; /* Pin 3 Control Register */
1924
register8_t PIN4CTRL; /* Pin 4 Control Register */
1925
register8_t PIN5CTRL; /* Pin 5 Control Register */
1926
register8_t PIN6CTRL; /* Pin 6 Control Register */
1927
register8_t PIN7CTRL; /* Pin 7 Control Register */
1930
/* Virtual Port 0 Mapping */
1931
typedef enum PORTCFG_VP0MAP_enum
1933
PORTCFG_VP0MAP_PORTA_gc = (0x00<<0), /* Mapped To PORTA */
1934
PORTCFG_VP0MAP_PORTB_gc = (0x01<<0), /* Mapped To PORTB */
1935
PORTCFG_VP0MAP_PORTC_gc = (0x02<<0), /* Mapped To PORTC */
1936
PORTCFG_VP0MAP_PORTD_gc = (0x03<<0), /* Mapped To PORTD */
1937
PORTCFG_VP0MAP_PORTE_gc = (0x04<<0), /* Mapped To PORTE */
1938
PORTCFG_VP0MAP_PORTF_gc = (0x05<<0), /* Mapped To PORTF */
1939
PORTCFG_VP0MAP_PORTG_gc = (0x06<<0), /* Mapped To PORTG */
1940
PORTCFG_VP0MAP_PORTH_gc = (0x07<<0), /* Mapped To PORTH */
1941
PORTCFG_VP0MAP_PORTJ_gc = (0x08<<0), /* Mapped To PORTJ */
1942
PORTCFG_VP0MAP_PORTK_gc = (0x09<<0), /* Mapped To PORTK */
1943
PORTCFG_VP0MAP_PORTL_gc = (0x0A<<0), /* Mapped To PORTL */
1944
PORTCFG_VP0MAP_PORTM_gc = (0x0B<<0), /* Mapped To PORTM */
1945
PORTCFG_VP0MAP_PORTN_gc = (0x0C<<0), /* Mapped To PORTN */
1946
PORTCFG_VP0MAP_PORTP_gc = (0x0D<<0), /* Mapped To PORTP */
1947
PORTCFG_VP0MAP_PORTQ_gc = (0x0E<<0), /* Mapped To PORTQ */
1948
PORTCFG_VP0MAP_PORTR_gc = (0x0F<<0), /* Mapped To PORTR */
1951
/* Virtual Port 1 Mapping */
1952
typedef enum PORTCFG_VP1MAP_enum
1954
PORTCFG_VP1MAP_PORTA_gc = (0x00<<4), /* Mapped To PORTA */
1955
PORTCFG_VP1MAP_PORTB_gc = (0x01<<4), /* Mapped To PORTB */
1956
PORTCFG_VP1MAP_PORTC_gc = (0x02<<4), /* Mapped To PORTC */
1957
PORTCFG_VP1MAP_PORTD_gc = (0x03<<4), /* Mapped To PORTD */
1958
PORTCFG_VP1MAP_PORTE_gc = (0x04<<4), /* Mapped To PORTE */
1959
PORTCFG_VP1MAP_PORTF_gc = (0x05<<4), /* Mapped To PORTF */
1960
PORTCFG_VP1MAP_PORTG_gc = (0x06<<4), /* Mapped To PORTG */
1961
PORTCFG_VP1MAP_PORTH_gc = (0x07<<4), /* Mapped To PORTH */
1962
PORTCFG_VP1MAP_PORTJ_gc = (0x08<<4), /* Mapped To PORTJ */
1963
PORTCFG_VP1MAP_PORTK_gc = (0x09<<4), /* Mapped To PORTK */
1964
PORTCFG_VP1MAP_PORTL_gc = (0x0A<<4), /* Mapped To PORTL */
1965
PORTCFG_VP1MAP_PORTM_gc = (0x0B<<4), /* Mapped To PORTM */
1966
PORTCFG_VP1MAP_PORTN_gc = (0x0C<<4), /* Mapped To PORTN */
1967
PORTCFG_VP1MAP_PORTP_gc = (0x0D<<4), /* Mapped To PORTP */
1968
PORTCFG_VP1MAP_PORTQ_gc = (0x0E<<4), /* Mapped To PORTQ */
1969
PORTCFG_VP1MAP_PORTR_gc = (0x0F<<4), /* Mapped To PORTR */
1972
/* Virtual Port 2 Mapping */
1973
typedef enum PORTCFG_VP2MAP_enum
1975
PORTCFG_VP2MAP_PORTA_gc = (0x00<<0), /* Mapped To PORTA */
1976
PORTCFG_VP2MAP_PORTB_gc = (0x01<<0), /* Mapped To PORTB */
1977
PORTCFG_VP2MAP_PORTC_gc = (0x02<<0), /* Mapped To PORTC */
1978
PORTCFG_VP2MAP_PORTD_gc = (0x03<<0), /* Mapped To PORTD */
1979
PORTCFG_VP2MAP_PORTE_gc = (0x04<<0), /* Mapped To PORTE */
1980
PORTCFG_VP2MAP_PORTF_gc = (0x05<<0), /* Mapped To PORTF */
1981
PORTCFG_VP2MAP_PORTG_gc = (0x06<<0), /* Mapped To PORTG */
1982
PORTCFG_VP2MAP_PORTH_gc = (0x07<<0), /* Mapped To PORTH */
1983
PORTCFG_VP2MAP_PORTJ_gc = (0x08<<0), /* Mapped To PORTJ */
1984
PORTCFG_VP2MAP_PORTK_gc = (0x09<<0), /* Mapped To PORTK */
1985
PORTCFG_VP2MAP_PORTL_gc = (0x0A<<0), /* Mapped To PORTL */
1986
PORTCFG_VP2MAP_PORTM_gc = (0x0B<<0), /* Mapped To PORTM */
1987
PORTCFG_VP2MAP_PORTN_gc = (0x0C<<0), /* Mapped To PORTN */
1988
PORTCFG_VP2MAP_PORTP_gc = (0x0D<<0), /* Mapped To PORTP */
1989
PORTCFG_VP2MAP_PORTQ_gc = (0x0E<<0), /* Mapped To PORTQ */
1990
PORTCFG_VP2MAP_PORTR_gc = (0x0F<<0), /* Mapped To PORTR */
1993
/* Virtual Port 3 Mapping */
1994
typedef enum PORTCFG_VP3MAP_enum
1996
PORTCFG_VP3MAP_PORTA_gc = (0x00<<4), /* Mapped To PORTA */
1997
PORTCFG_VP3MAP_PORTB_gc = (0x01<<4), /* Mapped To PORTB */
1998
PORTCFG_VP3MAP_PORTC_gc = (0x02<<4), /* Mapped To PORTC */
1999
PORTCFG_VP3MAP_PORTD_gc = (0x03<<4), /* Mapped To PORTD */
2000
PORTCFG_VP3MAP_PORTE_gc = (0x04<<4), /* Mapped To PORTE */
2001
PORTCFG_VP3MAP_PORTF_gc = (0x05<<4), /* Mapped To PORTF */
2002
PORTCFG_VP3MAP_PORTG_gc = (0x06<<4), /* Mapped To PORTG */
2003
PORTCFG_VP3MAP_PORTH_gc = (0x07<<4), /* Mapped To PORTH */
2004
PORTCFG_VP3MAP_PORTJ_gc = (0x08<<4), /* Mapped To PORTJ */
2005
PORTCFG_VP3MAP_PORTK_gc = (0x09<<4), /* Mapped To PORTK */
2006
PORTCFG_VP3MAP_PORTL_gc = (0x0A<<4), /* Mapped To PORTL */
2007
PORTCFG_VP3MAP_PORTM_gc = (0x0B<<4), /* Mapped To PORTM */
2008
PORTCFG_VP3MAP_PORTN_gc = (0x0C<<4), /* Mapped To PORTN */
2009
PORTCFG_VP3MAP_PORTP_gc = (0x0D<<4), /* Mapped To PORTP */
2010
PORTCFG_VP3MAP_PORTQ_gc = (0x0E<<4), /* Mapped To PORTQ */
2011
PORTCFG_VP3MAP_PORTR_gc = (0x0F<<4), /* Mapped To PORTR */
2014
/* Clock Output Port */
2015
typedef enum PORTCFG_CLKOUT_enum
2017
PORTCFG_CLKOUT_OFF_gc = (0x00<<0), /* Clock Output Disabled */
2018
PORTCFG_CLKOUT_PC7_gc = (0x01<<0), /* Clock Output on Port C pin 7 */
2019
PORTCFG_CLKOUT_PD7_gc = (0x02<<0), /* Clock Output on Port D pin 7 */
2020
PORTCFG_CLKOUT_PE7_gc = (0x03<<0), /* Clock Output on Port E pin 7 */
2023
/* Event Output Port */
2024
typedef enum PORTCFG_EVOUT_enum
2026
PORTCFG_EVOUT_OFF_gc = (0x00<<4), /* Event Output Disabled */
2027
PORTCFG_EVOUT_PC7_gc = (0x01<<4), /* Event Channel 7 Output on Port C pin 7 */
2028
PORTCFG_EVOUT_PD7_gc = (0x02<<4), /* Event Channel 7 Output on Port D pin 7 */
2029
PORTCFG_EVOUT_PE7_gc = (0x03<<4), /* Event Channel 7 Output on Port E pin 7 */
2032
/* Port Interrupt 0 Level */
2033
typedef enum PORT_INT0LVL_enum
2035
PORT_INT0LVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2036
PORT_INT0LVL_LO_gc = (0x01<<0), /* Low Level */
2037
PORT_INT0LVL_MED_gc = (0x02<<0), /* Medium Level */
2038
PORT_INT0LVL_HI_gc = (0x03<<0), /* High Level */
2041
/* Port Interrupt 1 Level */
2042
typedef enum PORT_INT1LVL_enum
2044
PORT_INT1LVL_OFF_gc = (0x00<<2), /* Interrupt Disabled */
2045
PORT_INT1LVL_LO_gc = (0x01<<2), /* Low Level */
2046
PORT_INT1LVL_MED_gc = (0x02<<2), /* Medium Level */
2047
PORT_INT1LVL_HI_gc = (0x03<<2), /* High Level */
2050
/* Output/Pull Configuration */
2051
typedef enum PORT_OPC_enum
2053
PORT_OPC_TOTEM_gc = (0x00<<3), /* Totempole */
2054
PORT_OPC_BUSKEEPER_gc = (0x01<<3), /* Totempole w/ Bus keeper on Input and Output */
2055
PORT_OPC_PULLDOWN_gc = (0x02<<3), /* Totempole w/ Pull-down on Input */
2056
PORT_OPC_PULLUP_gc = (0x03<<3), /* Totempole w/ Pull-up on Input */
2057
PORT_OPC_WIREDOR_gc = (0x04<<3), /* Wired OR */
2058
PORT_OPC_WIREDAND_gc = (0x05<<3), /* Wired AND */
2059
PORT_OPC_WIREDORPULL_gc = (0x06<<3), /* Wired OR w/ Pull-down */
2060
PORT_OPC_WIREDANDPULL_gc = (0x07<<3), /* Wired AND w/ Pull-up */
2063
/* Input/Sense Configuration */
2064
typedef enum PORT_ISC_enum
2066
PORT_ISC_BOTHEDGES_gc = (0x00<<0), /* Sense Both Edges */
2067
PORT_ISC_RISING_gc = (0x01<<0), /* Sense Rising Edge */
2068
PORT_ISC_FALLING_gc = (0x02<<0), /* Sense Falling Edge */
2069
PORT_ISC_LEVEL_gc = (0x03<<0), /* Sense Level (Transparent For Events) */
2070
PORT_ISC_INPUT_DISABLE_gc = (0x07<<0), /* Disable Digital Input Buffer */
2075
--------------------------------------------------------------------------
2076
TC - 16-bit Timer/Counter With PWM
2077
--------------------------------------------------------------------------
2080
/* 16-bit Timer/Counter 0 */
2081
typedef struct TC0_struct
2083
register8_t CTRLA; /* Control Register A */
2084
register8_t CTRLB; /* Control Register B */
2085
register8_t CTRLC; /* Control register C */
2086
register8_t CTRLD; /* Control Register D */
2087
register8_t CTRLE; /* Control Register E */
2088
register8_t reserved_0x05;
2089
register8_t INTCTRLA; /* Interrupt Control Register A */
2090
register8_t INTCTRLB; /* Interrupt Control Register B */
2091
register8_t CTRLFCLR; /* Control Register F Clear */
2092
register8_t CTRLFSET; /* Control Register F Set */
2093
register8_t CTRLGCLR; /* Control Register G Clear */
2094
register8_t CTRLGSET; /* Control Register G Set */
2095
register8_t INTFLAGS; /* Interrupt Flag Register */
2096
register8_t reserved_0x0D;
2097
register8_t reserved_0x0E;
2098
register8_t TEMP; /* Temporary Register For 16-bit Access */
2099
register8_t reserved_0x10;
2100
register8_t reserved_0x11;
2101
register8_t reserved_0x12;
2102
register8_t reserved_0x13;
2103
register8_t reserved_0x14;
2104
register8_t reserved_0x15;
2105
register8_t reserved_0x16;
2106
register8_t reserved_0x17;
2107
register8_t reserved_0x18;
2108
register8_t reserved_0x19;
2109
register8_t reserved_0x1A;
2110
register8_t reserved_0x1B;
2111
register8_t reserved_0x1C;
2112
register8_t reserved_0x1D;
2113
register8_t reserved_0x1E;
2114
register8_t reserved_0x1F;
2115
_WORDREGISTER(CNT); /* Count */
2116
register8_t reserved_0x22;
2117
register8_t reserved_0x23;
2118
register8_t reserved_0x24;
2119
register8_t reserved_0x25;
2120
_WORDREGISTER(PER); /* Period */
2121
_WORDREGISTER(CCA); /* Compare or Capture A */
2122
_WORDREGISTER(CCB); /* Compare or Capture B */
2123
_WORDREGISTER(CCC); /* Compare or Capture C */
2124
_WORDREGISTER(CCD); /* Compare or Capture D */
2125
register8_t reserved_0x30;
2126
register8_t reserved_0x31;
2127
register8_t reserved_0x32;
2128
register8_t reserved_0x33;
2129
register8_t reserved_0x34;
2130
register8_t reserved_0x35;
2131
_WORDREGISTER(PERBUF); /* Period Buffer */
2132
_WORDREGISTER(CCABUF); /* Compare Or Capture A Buffer */
2133
_WORDREGISTER(CCBBUF); /* Compare Or Capture B Buffer */
2134
_WORDREGISTER(CCCBUF); /* Compare Or Capture C Buffer */
2135
_WORDREGISTER(CCDBUF); /* Compare Or Capture D Buffer */
2139
--------------------------------------------------------------------------
2140
TC - 16-bit Timer/Counter With PWM
2141
--------------------------------------------------------------------------
2144
/* 16-bit Timer/Counter 1 */
2145
typedef struct TC1_struct
2147
register8_t CTRLA; /* Control Register A */
2148
register8_t CTRLB; /* Control Register B */
2149
register8_t CTRLC; /* Control register C */
2150
register8_t CTRLD; /* Control Register D */
2151
register8_t CTRLE; /* Control Register E */
2152
register8_t reserved_0x05;
2153
register8_t INTCTRLA; /* Interrupt Control Register A */
2154
register8_t INTCTRLB; /* Interrupt Control Register B */
2155
register8_t CTRLFCLR; /* Control Register F Clear */
2156
register8_t CTRLFSET; /* Control Register F Set */
2157
register8_t CTRLGCLR; /* Control Register G Clear */
2158
register8_t CTRLGSET; /* Control Register G Set */
2159
register8_t INTFLAGS; /* Interrupt Flag Register */
2160
register8_t reserved_0x0D;
2161
register8_t reserved_0x0E;
2162
register8_t TEMP; /* Temporary Register For 16-bit Access */
2163
register8_t reserved_0x10;
2164
register8_t reserved_0x11;
2165
register8_t reserved_0x12;
2166
register8_t reserved_0x13;
2167
register8_t reserved_0x14;
2168
register8_t reserved_0x15;
2169
register8_t reserved_0x16;
2170
register8_t reserved_0x17;
2171
register8_t reserved_0x18;
2172
register8_t reserved_0x19;
2173
register8_t reserved_0x1A;
2174
register8_t reserved_0x1B;
2175
register8_t reserved_0x1C;
2176
register8_t reserved_0x1D;
2177
register8_t reserved_0x1E;
2178
register8_t reserved_0x1F;
2179
_WORDREGISTER(CNT); /* Count */
2180
register8_t reserved_0x22;
2181
register8_t reserved_0x23;
2182
register8_t reserved_0x24;
2183
register8_t reserved_0x25;
2184
_WORDREGISTER(PER); /* Period */
2185
_WORDREGISTER(CCA); /* Compare or Capture A */
2186
_WORDREGISTER(CCB); /* Compare or Capture B */
2187
register8_t reserved_0x2C;
2188
register8_t reserved_0x2D;
2189
register8_t reserved_0x2E;
2190
register8_t reserved_0x2F;
2191
register8_t reserved_0x30;
2192
register8_t reserved_0x31;
2193
register8_t reserved_0x32;
2194
register8_t reserved_0x33;
2195
register8_t reserved_0x34;
2196
register8_t reserved_0x35;
2197
_WORDREGISTER(PERBUF); /* Period Buffer */
2198
_WORDREGISTER(CCABUF); /* Compare Or Capture A Buffer */
2199
_WORDREGISTER(CCBBUF); /* Compare Or Capture B Buffer */
2203
--------------------------------------------------------------------------
2204
TC - 16-bit Timer/Counter With PWM
2205
--------------------------------------------------------------------------
2208
/* Advanced Waveform Extension */
2209
typedef struct AWEX_struct
2211
register8_t CTRL; /* Control Register */
2212
register8_t reserved_0x01;
2213
register8_t FDEMASK; /* Fault Detection Event Mask */
2214
register8_t FDCTRL; /* Fault Detection Control Register */
2215
register8_t STATUS; /* Status Register */
2216
register8_t reserved_0x05;
2217
register8_t DTBOTH; /* Dead Time Both Sides */
2218
register8_t DTBOTHBUF; /* Dead Time Both Sides Buffer */
2219
register8_t DTLS; /* Dead Time Low Side */
2220
register8_t DTHS; /* Dead Time High Side */
2221
register8_t DTLSBUF; /* Dead Time Low Side Buffer */
2222
register8_t DTHSBUF; /* Dead Time High Side Buffer */
2223
register8_t OUTOVEN; /* Output Override Enable */
2227
--------------------------------------------------------------------------
2228
TC - 16-bit Timer/Counter With PWM
2229
--------------------------------------------------------------------------
2232
/* High-Resolution Extension */
2233
typedef struct HIRES_struct
2235
register8_t CTRLA; /* Control Register */
2238
/* Clock Selection */
2239
typedef enum TC_CLKSEL_enum
2241
TC_CLKSEL_OFF_gc = (0x00<<0), /* Timer Off */
2242
TC_CLKSEL_DIV1_gc = (0x01<<0), /* System Clock */
2243
TC_CLKSEL_DIV2_gc = (0x02<<0), /* System Clock / 2 */
2244
TC_CLKSEL_DIV4_gc = (0x03<<0), /* System Clock / 4 */
2245
TC_CLKSEL_DIV8_gc = (0x04<<0), /* System Clock / 8 */
2246
TC_CLKSEL_DIV64_gc = (0x05<<0), /* System Clock / 64 */
2247
TC_CLKSEL_DIV256_gc = (0x06<<0), /* System Clock / 256 */
2248
TC_CLKSEL_DIV1024_gc = (0x07<<0), /* System Clock / 1024 */
2249
TC_CLKSEL_EVCH0_gc = (0x08<<0), /* Event Channel 0 */
2250
TC_CLKSEL_EVCH1_gc = (0x09<<0), /* Event Channel 1 */
2251
TC_CLKSEL_EVCH2_gc = (0x0A<<0), /* Event Channel 2 */
2252
TC_CLKSEL_EVCH3_gc = (0x0B<<0), /* Event Channel 3 */
2253
TC_CLKSEL_EVCH4_gc = (0x0C<<0), /* Event Channel 4 */
2254
TC_CLKSEL_EVCH5_gc = (0x0D<<0), /* Event Channel 5 */
2255
TC_CLKSEL_EVCH6_gc = (0x0E<<0), /* Event Channel 6 */
2256
TC_CLKSEL_EVCH7_gc = (0x0F<<0), /* Event Channel 7 */
2259
/* Waveform Generation Mode */
2260
typedef enum TC_WGMODE_enum
2262
TC_WGMODE_NORMAL_gc = (0x00<<0), /* Normal Mode */
2263
TC_WGMODE_FRQ_gc = (0x01<<0), /* Frequency Generation Mode */
2264
TC_WGMODE_SS_gc = (0x03<<0), /* Single Slope */
2265
TC_WGMODE_DS_T_gc = (0x05<<0), /* Dual Slope, Update on TOP */
2266
TC_WGMODE_DS_TB_gc = (0x06<<0), /* Dual Slope, Update on TOP and BOTTOM */
2267
TC_WGMODE_DS_B_gc = (0x07<<0), /* Dual Slope, Update on BOTTOM */
2271
typedef enum TC_EVACT_enum
2273
TC_EVACT_OFF_gc = (0x00<<5), /* No Event Action */
2274
TC_EVACT_CAPT_gc = (0x01<<5), /* Input Capture */
2275
TC_EVACT_UPDOWN_gc = (0x02<<5), /* Externally Controlled Up/Down Count */
2276
TC_EVACT_QDEC_gc = (0x03<<5), /* Quadrature Decode */
2277
TC_EVACT_RESTART_gc = (0x04<<5), /* Restart */
2278
TC_EVACT_FRW_gc = (0x05<<5), /* Frequency Capture */
2279
TC_EVACT_PW_gc = (0x06<<5), /* Pulse-width Capture */
2282
/* Event Selection */
2283
typedef enum TC_EVSEL_enum
2285
TC_EVSEL_OFF_gc = (0x00<<0), /* No Event Source */
2286
TC_EVSEL_CH0_gc = (0x08<<0), /* Event Channel 0 */
2287
TC_EVSEL_CH1_gc = (0x09<<0), /* Event Channel 1 */
2288
TC_EVSEL_CH2_gc = (0x0A<<0), /* Event Channel 2 */
2289
TC_EVSEL_CH3_gc = (0x0B<<0), /* Event Channel 3 */
2290
TC_EVSEL_CH4_gc = (0x0C<<0), /* Event Channel 4 */
2291
TC_EVSEL_CH5_gc = (0x0D<<0), /* Event Channel 5 */
2292
TC_EVSEL_CH6_gc = (0x0E<<0), /* Event Channel 6 */
2293
TC_EVSEL_CH7_gc = (0x0F<<0), /* Event Channel 7 */
2296
/* Error Interrupt Level */
2297
typedef enum TC_ERRINTLVL_enum
2299
TC_ERRINTLVL_OFF_gc = (0x00<<2), /* Interrupt Disabled */
2300
TC_ERRINTLVL_LO_gc = (0x01<<2), /* Low Level */
2301
TC_ERRINTLVL_MED_gc = (0x02<<2), /* Medium Level */
2302
TC_ERRINTLVL_HI_gc = (0x03<<2), /* High Level */
2305
/* Overflow Interrupt Level */
2306
typedef enum TC_OVFINTLVL_enum
2308
TC_OVFINTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2309
TC_OVFINTLVL_LO_gc = (0x01<<0), /* Low Level */
2310
TC_OVFINTLVL_MED_gc = (0x02<<0), /* Medium Level */
2311
TC_OVFINTLVL_HI_gc = (0x03<<0), /* High Level */
2314
/* Compare or Capture D Interrupt Level */
2315
typedef enum TC_CCDINTLVL_enum
2317
TC_CCDINTLVL_OFF_gc = (0x00<<6), /* Interrupt Disabled */
2318
TC_CCDINTLVL_LO_gc = (0x01<<6), /* Low Level */
2319
TC_CCDINTLVL_MED_gc = (0x02<<6), /* Medium Level */
2320
TC_CCDINTLVL_HI_gc = (0x03<<6), /* High Level */
2323
/* Compare or Capture C Interrupt Level */
2324
typedef enum TC_CCCINTLVL_enum
2326
TC_CCCINTLVL_OFF_gc = (0x00<<4), /* Interrupt Disabled */
2327
TC_CCCINTLVL_LO_gc = (0x01<<4), /* Low Level */
2328
TC_CCCINTLVL_MED_gc = (0x02<<4), /* Medium Level */
2329
TC_CCCINTLVL_HI_gc = (0x03<<4), /* High Level */
2332
/* Compare or Capture B Interrupt Level */
2333
typedef enum TC_CCBINTLVL_enum
2335
TC_CCBINTLVL_OFF_gc = (0x00<<2), /* Interrupt Disabled */
2336
TC_CCBINTLVL_LO_gc = (0x01<<2), /* Low Level */
2337
TC_CCBINTLVL_MED_gc = (0x02<<2), /* Medium Level */
2338
TC_CCBINTLVL_HI_gc = (0x03<<2), /* High Level */
2341
/* Compare or Capture A Interrupt Level */
2342
typedef enum TC_CCAINTLVL_enum
2344
TC_CCAINTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2345
TC_CCAINTLVL_LO_gc = (0x01<<0), /* Low Level */
2346
TC_CCAINTLVL_MED_gc = (0x02<<0), /* Medium Level */
2347
TC_CCAINTLVL_HI_gc = (0x03<<0), /* High Level */
2350
/* Timer/Counter Command */
2351
typedef enum TC_CMD_enum
2353
TC_CMD_NONE_gc = (0x00<<2), /* No Command */
2354
TC_CMD_UPDATE_gc = (0x01<<2), /* Force Update */
2355
TC_CMD_RESTART_gc = (0x02<<2), /* Force Restart */
2356
TC_CMD_RESET_gc = (0x03<<2), /* Force Hard Reset */
2359
/* Fault Detect Action */
2360
typedef enum AWEX_FDACT_enum
2362
AWEX_FDACT_NONE_gc = (0x00<<0), /* No Fault Protection */
2363
AWEX_FDACT_CLEAROE_gc = (0x01<<0), /* Clear Output Enable Bits */
2364
AWEX_FDACT_CLEARDIR_gc = (0x03<<0), /* Clear I/O Port Direction Bits */
2367
/* High Resolution Enable */
2368
typedef enum HIRES_HREN_enum
2370
HIRES_HREN_NONE_gc = (0x00<<0), /* No Fault Protection */
2371
HIRES_HREN_TC0_gc = (0x01<<0), /* Enable High Resolution on Timer/Counter 0 */
2372
HIRES_HREN_TC1_gc = (0x02<<0), /* Enable High Resolution on Timer/Counter 1 */
2373
HIRES_HREN_BOTH_gc = (0x03<<0), /* Enable High Resolution both Timer/Counters */
2378
--------------------------------------------------------------------------
2379
USART - Universal Asynchronous Receiver-Transmitter
2380
--------------------------------------------------------------------------
2383
/* Universal Synchronous/Asynchronous Receiver/Transmitter */
2384
typedef struct USART_struct
2386
register8_t DATA; /* Data Register */
2387
register8_t STATUS; /* Status Register */
2388
register8_t reserved_0x02;
2389
register8_t CTRLA; /* Control Register A */
2390
register8_t CTRLB; /* Control Register B */
2391
register8_t CTRLC; /* Control Register C */
2392
register8_t BAUDCTRLA; /* Baud Rate Control Register A */
2393
register8_t BAUDCTRLB; /* Baud Rate Control Register B */
2396
/* Receive Complete Interrupt level */
2397
typedef enum USART_RXCINTLVL_enum
2399
USART_RXCINTLVL_OFF_gc = (0x00<<4), /* Interrupt Disabled */
2400
USART_RXCINTLVL_LO_gc = (0x01<<4), /* Low Level */
2401
USART_RXCINTLVL_MED_gc = (0x02<<4), /* Medium Level */
2402
USART_RXCINTLVL_HI_gc = (0x03<<4), /* High Level */
2403
} USART_RXCINTLVL_t;
2405
/* Transmit Complete Interrupt level */
2406
typedef enum USART_TXCINTLVL_enum
2408
USART_TXCINTLVL_OFF_gc = (0x00<<2), /* Interrupt Disabled */
2409
USART_TXCINTLVL_LO_gc = (0x01<<2), /* Low Level */
2410
USART_TXCINTLVL_MED_gc = (0x02<<2), /* Medium Level */
2411
USART_TXCINTLVL_HI_gc = (0x03<<2), /* High Level */
2412
} USART_TXCINTLVL_t;
2414
/* Data Register Empty Interrupt level */
2415
typedef enum USART_DREINTLVL_enum
2417
USART_DREINTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2418
USART_DREINTLVL_LO_gc = (0x01<<0), /* Low Level */
2419
USART_DREINTLVL_MED_gc = (0x02<<0), /* Medium Level */
2420
USART_DREINTLVL_HI_gc = (0x03<<0), /* High Level */
2421
} USART_DREINTLVL_t;
2423
/* Character Size */
2424
typedef enum USART_CHSIZE_enum
2426
USART_CHSIZE_5BIT_gc = (0x00<<0), /* Character size: 5 bit */
2427
USART_CHSIZE_6BIT_gc = (0x01<<0), /* Character size: 6 bit */
2428
USART_CHSIZE_7BIT_gc = (0x02<<0), /* Character size: 7 bit */
2429
USART_CHSIZE_8BIT_gc = (0x03<<0), /* Character size: 8 bit */
2430
USART_CHSIZE_9BIT_gc = (0x07<<0), /* Character size: 9 bit */
2433
/* Communication Mode */
2434
typedef enum USART_CMODE_enum
2436
USART_CMODE_ASYNCHRONOUS_gc = (0x00<<6), /* Asynchronous Mode */
2437
USART_CMODE_SYNCHRONOUS_gc = (0x01<<6), /* Synchronous Mode */
2438
USART_CMODE_IRDA_gc = (0x02<<6), /* IrDA Mode */
2439
USART_CMODE_MSPI_gc = (0x03<<6), /* Master SPI Mode */
2443
typedef enum USART_PMODE_enum
2445
USART_PMODE_DISABLED_gc = (0x00<<4), /* No Parity */
2446
USART_PMODE_EVEN_gc = (0x02<<4), /* Even Parity */
2447
USART_PMODE_ODD_gc = (0x03<<4), /* Odd Parity */
2452
--------------------------------------------------------------------------
2453
SPI - Serial Peripheral Interface
2454
--------------------------------------------------------------------------
2457
/* Serial Peripheral Interface */
2458
typedef struct SPI_struct
2460
register8_t CTRL; /* Control Register */
2461
register8_t INTCTRL; /* Interrupt Control Register */
2462
register8_t STATUS; /* Status Register */
2463
register8_t DATA; /* Data Register */
2467
typedef enum SPI_MODE_enum
2469
SPI_MODE_0_gc = (0x00<<2), /* SPI Mode 0 */
2470
SPI_MODE_1_gc = (0x01<<2), /* SPI Mode 1 */
2471
SPI_MODE_2_gc = (0x02<<2), /* SPI Mode 2 */
2472
SPI_MODE_3_gc = (0x03<<2), /* SPI Mode 3 */
2475
/* Prescaler setting */
2476
typedef enum SPI_PRESCALER_enum
2478
SPI_PRESCALER_DIV4_gc = (0x00<<0), /* System Clock / 4 */
2479
SPI_PRESCALER_DIV16_gc = (0x01<<0), /* System Clock / 16 */
2480
SPI_PRESCALER_DIV64_gc = (0x02<<0), /* System Clock / 64 */
2481
SPI_PRESCALER_DIV128_gc = (0x03<<0), /* System Clock / 128 */
2484
/* Interrupt level */
2485
typedef enum SPI_INTLVL_enum
2487
SPI_INTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2488
SPI_INTLVL_LO_gc = (0x01<<0), /* Low Level */
2489
SPI_INTLVL_MED_gc = (0x02<<0), /* Medium Level */
2490
SPI_INTLVL_HI_gc = (0x03<<0), /* High Level */
2495
--------------------------------------------------------------------------
2496
IRCOM - IR Communication Module
2497
--------------------------------------------------------------------------
2500
/* IR Communication Module */
2501
typedef struct IRCOM_struct
2503
register8_t CTRL; /* Control Register */
2504
register8_t TXPLCTRL; /* IrDA Transmitter Pulse Length Control Register */
2505
register8_t RXPLCTRL; /* IrDA Receiver Pulse Length Control Register */
2508
/* Event channel selection */
2509
typedef enum IRDA_EVSEL_enum
2511
IRDA_EVSEL_OFF_gc = (0x00<<0), /* No Event Source */
2512
IRDA_EVSEL_0_gc = (0x08<<0), /* Event Channel 0 */
2513
IRDA_EVSEL_1_gc = (0x09<<0), /* Event Channel 1 */
2514
IRDA_EVSEL_2_gc = (0x0A<<0), /* Event Channel 2 */
2515
IRDA_EVSEL_3_gc = (0x0B<<0), /* Event Channel 3 */
2516
IRDA_EVSEL_4_gc = (0x0C<<0), /* Event Channel 4 */
2517
IRDA_EVSEL_5_gc = (0x0D<<0), /* Event Channel 5 */
2518
IRDA_EVSEL_6_gc = (0x0E<<0), /* Event Channel 6 */
2519
IRDA_EVSEL_7_gc = (0x0F<<0), /* Event Channel 7 */
2524
--------------------------------------------------------------------------
2526
--------------------------------------------------------------------------
2530
typedef struct AES_struct
2532
register8_t CTRL; /* AES Control Register */
2533
register8_t STATUS; /* AES Status Register */
2534
register8_t STATE; /* AES State Register */
2535
register8_t KEY; /* AES Key Register */
2536
register8_t INTCTRL; /* AES Interrupt Control Register */
2539
/* Interrupt level */
2540
typedef enum AES_INTLVL_enum
2542
AES_INTLVL_OFF_gc = (0x00<<0), /* Interrupt Disabled */
2543
AES_INTLVL_LO_gc = (0x01<<0), /* Low Level */
2544
AES_INTLVL_MED_gc = (0x02<<0), /* Medium Level */
2545
AES_INTLVL_HI_gc = (0x03<<0), /* High Level */
2551
==========================================================================
2552
IO Module Instances. Mapped to memory.
2553
==========================================================================
2556
#define VPORT0 (*(VPORT_t *) 0x0010) /* Virtual Port 0 */
2557
#define VPORT1 (*(VPORT_t *) 0x0014) /* Virtual Port 1 */
2558
#define VPORT2 (*(VPORT_t *) 0x0018) /* Virtual Port 2 */
2559
#define VPORT3 (*(VPORT_t *) 0x001C) /* Virtual Port 3 */
2560
#define OCD (*(OCD_t *) 0x002E) /* On-Chip Debug System */
2561
#define CLK (*(CLK_t *) 0x0040) /* Clock System */
2562
#define SLEEP (*(SLEEP_t *) 0x0048) /* Sleep Controller */
2563
#define OSC (*(OSC_t *) 0x0050) /* Oscillator Control */
2564
#define DFLLRC32M (*(DFLL_t *) 0x0060) /* DFLL for 32MHz RC Oscillator */
2565
#define DFLLRC2M (*(DFLL_t *) 0x0068) /* DFLL for 2MHz RC Oscillator */
2566
#define PR (*(PR_t *) 0x0070) /* Power Reduction */
2567
#define RST (*(RST_t *) 0x0078) /* Reset Controller */
2568
#define WDT (*(WDT_t *) 0x0080) /* Watch-Dog Timer */
2569
#define MCU (*(MCU_t *) 0x0090) /* MCU Control */
2570
#define PMIC (*(PMIC_t *) 0x00A0) /* Programmable Interrupt Controller */
2571
#define PORTCFG (*(PORTCFG_t *) 0x00B0) /* Port Configuration */
2572
#define AES (*(AES_t *) 0x00C0) /* AES Crypto Module */
2573
#define DMA (*(DMA_t *) 0x0100) /* DMA Controller */
2574
#define EVSYS (*(EVSYS_t *) 0x0180) /* Event System */
2575
#define NVM (*(NVM_t *) 0x01C0) /* Non Volatile Memory Controller */
2576
#define ADCA (*(ADC_t *) 0x0200) /* Analog to Digital Converter A */
2577
#define ADCB (*(ADC_t *) 0x0240) /* Analog to Digital Converter B */
2578
#define DACB (*(DAC_t *) 0x0320) /* Digital to Analog Converter B */
2579
#define ACA (*(AC_t *) 0x0380) /* Analog Comparator A */
2580
#define ACB (*(AC_t *) 0x0390) /* Analog Comparator B */
2581
#define RTC (*(RTC_t *) 0x0400) /* Real-Time Counter */
2582
#define TWIC (*(TWI_t *) 0x0480) /* Two-Wire Interface C */
2583
#define TWIE (*(TWI_t *) 0x04A0) /* Two-Wire Interface E */
2584
#define PORTA (*(PORT_t *) 0x0600) /* Port A */
2585
#define PORTB (*(PORT_t *) 0x0620) /* Port B */
2586
#define PORTC (*(PORT_t *) 0x0640) /* Port C */
2587
#define PORTD (*(PORT_t *) 0x0660) /* Port D */
2588
#define PORTE (*(PORT_t *) 0x0680) /* Port E */
2589
#define PORTF (*(PORT_t *) 0x06A0) /* Port F */
2590
#define PORTR (*(PORT_t *) 0x07E0) /* Port R */
2591
#define TCC0 (*(TC0_t *) 0x0800) /* Timer/Counter C0 */
2592
#define TCC1 (*(TC1_t *) 0x0840) /* Timer/Counter C1 */
2593
#define AWEXC (*(AWEX_t *) 0x0880) /* Advanced Waveform Extension C */
2594
#define HIRESC (*(HIRES_t *) 0x0890) /* High-Resolution Extension C */
2595
#define USARTC0 (*(USART_t *) 0x08A0) /* Universal Asynchronous Receiver-Transmitter C0 */
2596
#define USARTC1 (*(USART_t *) 0x08B0) /* Universal Asynchronous Receiver-Transmitter C1 */
2597
#define SPIC (*(SPI_t *) 0x08C0) /* Serial Peripheral Interface C */
2598
#define IRCOM (*(IRCOM_t *) 0x08F8) /* IR Communication Module */
2599
#define TCD0 (*(TC0_t *) 0x0900) /* Timer/Counter D0 */
2600
#define TCD1 (*(TC1_t *) 0x0940) /* Timer/Counter D1 */
2601
#define HIRESD (*(HIRES_t *) 0x0990) /* High-Resolution Extension D */
2602
#define USARTD0 (*(USART_t *) 0x09A0) /* Universal Asynchronous Receiver-Transmitter D0 */
2603
#define USARTD1 (*(USART_t *) 0x09B0) /* Universal Asynchronous Receiver-Transmitter D1 */
2604
#define SPID (*(SPI_t *) 0x09C0) /* Serial Peripheral Interface D */
2605
#define TCE0 (*(TC0_t *) 0x0A00) /* Timer/Counter E0 */
2606
#define TCE1 (*(TC1_t *) 0x0A40) /* Timer/Counter E1 */
2607
#define AWEXE (*(AWEX_t *) 0x0A80) /* Advanced Waveform Extension E */
2608
#define HIRESE (*(HIRES_t *) 0x0A90) /* High-Resolution Extension E */
2609
#define USARTE0 (*(USART_t *) 0x0AA0) /* Universal Asynchronous Receiver-Transmitter E0 */
2610
#define USARTE1 (*(USART_t *) 0x0AB0) /* Universal Asynchronous Receiver-Transmitter E1 */
2611
#define SPIE (*(SPI_t *) 0x0AC0) /* Serial Peripheral Interface E */
2612
#define TCF0 (*(TC0_t *) 0x0B00) /* Timer/Counter F0 */
2613
#define HIRESF (*(HIRES_t *) 0x0B90) /* High-Resolution Extension F */
2614
#define USARTF0 (*(USART_t *) 0x0BA0) /* Universal Asynchronous Receiver-Transmitter F0 */
2615
#define USARTF1 (*(USART_t *) 0x0BB0) /* Universal Asynchronous Receiver-Transmitter F1 */
2616
#define SPIF (*(SPI_t *) 0x0BC0) /* Serial Peripheral Interface F */
2619
#endif /* !defined (__ASSEMBLER__) */
2622
/* ========== Flattened fully qualified IO register names ========== */
2624
/* GPIO - General Purpose IO Registers */
2625
#define GPIO_GPIOR0 _SFR_MEM8(0x0000)
2626
#define GPIO_GPIOR1 _SFR_MEM8(0x0001)
2627
#define GPIO_GPIOR2 _SFR_MEM8(0x0002)
2628
#define GPIO_GPIOR3 _SFR_MEM8(0x0003)
2629
#define GPIO_GPIOR4 _SFR_MEM8(0x0004)
2630
#define GPIO_GPIOR5 _SFR_MEM8(0x0005)
2631
#define GPIO_GPIOR6 _SFR_MEM8(0x0006)
2632
#define GPIO_GPIOR7 _SFR_MEM8(0x0007)
2633
#define GPIO_GPIOR8 _SFR_MEM8(0x0008)
2634
#define GPIO_GPIOR9 _SFR_MEM8(0x0009)
2635
#define GPIO_GPIORA _SFR_MEM8(0x000A)
2636
#define GPIO_GPIORB _SFR_MEM8(0x000B)
2637
#define GPIO_GPIORC _SFR_MEM8(0x000C)
2638
#define GPIO_GPIORD _SFR_MEM8(0x000D)
2639
#define GPIO_GPIORE _SFR_MEM8(0x000E)
2640
#define GPIO_GPIORF _SFR_MEM8(0x000F)
2643
#define GPIO_GPIO0 _SFR_MEM8(0x0000)
2644
#define GPIO_GPIO1 _SFR_MEM8(0x0001)
2645
#define GPIO_GPIO2 _SFR_MEM8(0x0002)
2646
#define GPIO_GPIO3 _SFR_MEM8(0x0003)
2647
#define GPIO_GPIO4 _SFR_MEM8(0x0004)
2648
#define GPIO_GPIO5 _SFR_MEM8(0x0005)
2649
#define GPIO_GPIO6 _SFR_MEM8(0x0006)
2650
#define GPIO_GPIO7 _SFR_MEM8(0x0007)
2651
#define GPIO_GPIO8 _SFR_MEM8(0x0008)
2652
#define GPIO_GPIO9 _SFR_MEM8(0x0009)
2653
#define GPIO_GPIOA _SFR_MEM8(0x000A)
2654
#define GPIO_GPIOB _SFR_MEM8(0x000B)
2655
#define GPIO_GPIOC _SFR_MEM8(0x000C)
2656
#define GPIO_GPIOD _SFR_MEM8(0x000D)
2657
#define GPIO_GPIOE _SFR_MEM8(0x000E)
2658
#define GPIO_GPIOF _SFR_MEM8(0x000F)
2660
/* VPORT0 - Virtual Port 0 */
2661
#define VPORT0_DIR _SFR_MEM8(0x0010)
2662
#define VPORT0_OUT _SFR_MEM8(0x0011)
2663
#define VPORT0_IN _SFR_MEM8(0x0012)
2664
#define VPORT0_INTFLAGS _SFR_MEM8(0x0013)
2666
/* VPORT1 - Virtual Port 1 */
2667
#define VPORT1_DIR _SFR_MEM8(0x0014)
2668
#define VPORT1_OUT _SFR_MEM8(0x0015)
2669
#define VPORT1_IN _SFR_MEM8(0x0016)
2670
#define VPORT1_INTFLAGS _SFR_MEM8(0x0017)
2672
/* VPORT2 - Virtual Port 2 */
2673
#define VPORT2_DIR _SFR_MEM8(0x0018)
2674
#define VPORT2_OUT _SFR_MEM8(0x0019)
2675
#define VPORT2_IN _SFR_MEM8(0x001A)
2676
#define VPORT2_INTFLAGS _SFR_MEM8(0x001B)
2678
/* VPORT3 - Virtual Port 3 */
2679
#define VPORT3_DIR _SFR_MEM8(0x001C)
2680
#define VPORT3_OUT _SFR_MEM8(0x001D)
2681
#define VPORT3_IN _SFR_MEM8(0x001E)
2682
#define VPORT3_INTFLAGS _SFR_MEM8(0x001F)
2684
/* OCD - On-Chip Debug System */
2685
#define OCD_OCDR0 _SFR_MEM8(0x002E)
2686
#define OCD_OCDR1 _SFR_MEM8(0x002F)
2688
/* CPU - CPU Registers */
2689
#define CPU_CCP _SFR_MEM8(0x0034)
2690
#define CPU_RAMPD _SFR_MEM8(0x0038)
2691
#define CPU_RAMPX _SFR_MEM8(0x0039)
2692
#define CPU_RAMPY _SFR_MEM8(0x003A)
2693
#define CPU_RAMPZ _SFR_MEM8(0x003B)
2694
#define CPU_EIND _SFR_MEM8(0x003C)
2695
#define CPU_SPL _SFR_MEM8(0x003D)
2696
#define CPU_SPH _SFR_MEM8(0x003E)
2697
#define CPU_SREG _SFR_MEM8(0x003F)
2699
/* CLK - Clock System */
2700
#define CLK_CTRL _SFR_MEM8(0x0040)
2701
#define CLK_PSCTRL _SFR_MEM8(0x0041)
2702
#define CLK_LOCK _SFR_MEM8(0x0042)
2703
#define CLK_RTCCTRL _SFR_MEM8(0x0043)
2705
/* SLEEP - Sleep Controller */
2706
#define SLEEP_CTRL _SFR_MEM8(0x0048)
2708
/* OSC - Oscillator Control */
2709
#define OSC_CTRL _SFR_MEM8(0x0050)
2710
#define OSC_STATUS _SFR_MEM8(0x0051)
2711
#define OSC_XOSCCTRL _SFR_MEM8(0x0052)
2712
#define OSC_XOSCFAIL _SFR_MEM8(0x0053)
2713
#define OSC_RC32KCAL _SFR_MEM8(0x0054)
2714
#define OSC_PLLCTRL _SFR_MEM8(0x0055)
2715
#define OSC_DFLLCTRL _SFR_MEM8(0x0056)
2717
/* DFLLRC32M - DFLL for 32MHz RC Oscillator */
2718
#define DFLLRC32M_CTRL _SFR_MEM8(0x0060)
2719
#define DFLLRC32M_CALA _SFR_MEM8(0x0062)
2720
#define DFLLRC32M_CALB _SFR_MEM8(0x0063)
2721
#define DFLLRC32M_COMP0 _SFR_MEM8(0x0064)
2722
#define DFLLRC32M_COMP1 _SFR_MEM8(0x0065)
2723
#define DFLLRC32M_COMP2 _SFR_MEM8(0x0066)
2725
/* DFLLRC2M - DFLL for 2MHz RC Oscillator */
2726
#define DFLLRC2M_CTRL _SFR_MEM8(0x0068)
2727
#define DFLLRC2M_CALA _SFR_MEM8(0x006A)
2728
#define DFLLRC2M_CALB _SFR_MEM8(0x006B)
2729
#define DFLLRC2M_COMP0 _SFR_MEM8(0x006C)
2730
#define DFLLRC2M_COMP1 _SFR_MEM8(0x006D)
2731
#define DFLLRC2M_COMP2 _SFR_MEM8(0x006E)
2733
/* PR - Power Reduction */
2734
#define PR_PRGEN _SFR_MEM8(0x0070)
2735
#define PR_PRPA _SFR_MEM8(0x0071)
2736
#define PR_PRPB _SFR_MEM8(0x0072)
2737
#define PR_PRPC _SFR_MEM8(0x0073)
2738
#define PR_PRPD _SFR_MEM8(0x0074)
2739
#define PR_PRPE _SFR_MEM8(0x0075)
2740
#define PR_PRPF _SFR_MEM8(0x0076)
2742
/* RST - Reset Controller */
2743
#define RST_STATUS _SFR_MEM8(0x0078)
2744
#define RST_CTRL _SFR_MEM8(0x0079)
2746
/* WDT - Watch-Dog Timer */
2747
#define WDT_CTRL _SFR_MEM8(0x0080)
2748
#define WDT_WINCTRL _SFR_MEM8(0x0081)
2749
#define WDT_STATUS _SFR_MEM8(0x0082)
2751
/* MCU - MCU Control */
2752
#define MCU_DEVID0 _SFR_MEM8(0x0090)
2753
#define MCU_DEVID1 _SFR_MEM8(0x0091)
2754
#define MCU_DEVID2 _SFR_MEM8(0x0092)
2755
#define MCU_REVID _SFR_MEM8(0x0093)
2756
#define MCU_JTAGUID _SFR_MEM8(0x0094)
2757
#define MCU_MCUCR _SFR_MEM8(0x0096)
2758
#define MCU_EVSYSLOCK _SFR_MEM8(0x0098)
2759
#define MCU_AWEXLOCK _SFR_MEM8(0x0099)
2761
/* PMIC - Programmable Interrupt Controller */
2762
#define PMIC_STATUS _SFR_MEM8(0x00A0)
2763
#define PMIC_INTPRI _SFR_MEM8(0x00A1)
2764
#define PMIC_CTRL _SFR_MEM8(0x00A2)
2766
/* PORTCFG - Port Configuration */
2767
#define PORTCFG_MPCMASK _SFR_MEM8(0x00B0)
2768
#define PORTCFG_VPCTRLA _SFR_MEM8(0x00B2)
2769
#define PORTCFG_VPCTRLB _SFR_MEM8(0x00B3)
2770
#define PORTCFG_CLKEVOUT _SFR_MEM8(0x00B4)
2772
/* AES - AES Crypto Module */
2773
#define AES_CTRL _SFR_MEM8(0x00C0)
2774
#define AES_STATUS _SFR_MEM8(0x00C1)
2775
#define AES_STATE _SFR_MEM8(0x00C2)
2776
#define AES_KEY _SFR_MEM8(0x00C3)
2777
#define AES_INTCTRL _SFR_MEM8(0x00C4)
2779
/* DMA - DMA Controller */
2780
#define DMA_CTRL _SFR_MEM8(0x0100)
2781
#define DMA_INTFLAGS _SFR_MEM8(0x0103)
2782
#define DMA_STATUS _SFR_MEM8(0x0104)
2783
#define DMA_TEMP _SFR_MEM16(0x0106)
2784
#define DMA_CH0_CTRLA _SFR_MEM8(0x0110)
2785
#define DMA_CH0_CTRLB _SFR_MEM8(0x0111)
2786
#define DMA_CH0_ADDRCTRL _SFR_MEM8(0x0112)
2787
#define DMA_CH0_TRIGSRC _SFR_MEM8(0x0113)
2788
#define DMA_CH0_TRFCNT _SFR_MEM16(0x0114)
2789
#define DMA_CH0_REPCNT _SFR_MEM8(0x0116)
2790
#define DMA_CH0_SRCADDR0 _SFR_MEM8(0x0118)
2791
#define DMA_CH0_SRCADDR1 _SFR_MEM8(0x0119)
2792
#define DMA_CH0_SRCADDR2 _SFR_MEM8(0x011A)
2793
#define DMA_CH0_DESTADDR0 _SFR_MEM8(0x011C)
2794
#define DMA_CH0_DESTADDR1 _SFR_MEM8(0x011D)
2795
#define DMA_CH0_DESTADDR2 _SFR_MEM8(0x011E)
2796
#define DMA_CH1_CTRLA _SFR_MEM8(0x0120)
2797
#define DMA_CH1_CTRLB _SFR_MEM8(0x0121)
2798
#define DMA_CH1_ADDRCTRL _SFR_MEM8(0x0122)
2799
#define DMA_CH1_TRIGSRC _SFR_MEM8(0x0123)
2800
#define DMA_CH1_TRFCNT _SFR_MEM16(0x0124)
2801
#define DMA_CH1_REPCNT _SFR_MEM8(0x0126)
2802
#define DMA_CH1_SRCADDR0 _SFR_MEM8(0x0128)
2803
#define DMA_CH1_SRCADDR1 _SFR_MEM8(0x0129)
2804
#define DMA_CH1_SRCADDR2 _SFR_MEM8(0x012A)
2805
#define DMA_CH1_DESTADDR0 _SFR_MEM8(0x012C)
2806
#define DMA_CH1_DESTADDR1 _SFR_MEM8(0x012D)
2807
#define DMA_CH1_DESTADDR2 _SFR_MEM8(0x012E)
2808
#define DMA_CH2_CTRLA _SFR_MEM8(0x0130)
2809
#define DMA_CH2_CTRLB _SFR_MEM8(0x0131)
2810
#define DMA_CH2_ADDRCTRL _SFR_MEM8(0x0132)
2811
#define DMA_CH2_TRIGSRC _SFR_MEM8(0x0133)
2812
#define DMA_CH2_TRFCNT _SFR_MEM16(0x0134)
2813
#define DMA_CH2_REPCNT _SFR_MEM8(0x0136)
2814
#define DMA_CH2_SRCADDR0 _SFR_MEM8(0x0138)
2815
#define DMA_CH2_SRCADDR1 _SFR_MEM8(0x0139)
2816
#define DMA_CH2_SRCADDR2 _SFR_MEM8(0x013A)
2817
#define DMA_CH2_DESTADDR0 _SFR_MEM8(0x013C)
2818
#define DMA_CH2_DESTADDR1 _SFR_MEM8(0x013D)
2819
#define DMA_CH2_DESTADDR2 _SFR_MEM8(0x013E)
2820
#define DMA_CH3_CTRLA _SFR_MEM8(0x0140)
2821
#define DMA_CH3_CTRLB _SFR_MEM8(0x0141)
2822
#define DMA_CH3_ADDRCTRL _SFR_MEM8(0x0142)
2823
#define DMA_CH3_TRIGSRC _SFR_MEM8(0x0143)
2824
#define DMA_CH3_TRFCNT _SFR_MEM16(0x0144)
2825
#define DMA_CH3_REPCNT _SFR_MEM8(0x0146)
2826
#define DMA_CH3_SRCADDR0 _SFR_MEM8(0x0148)
2827
#define DMA_CH3_SRCADDR1 _SFR_MEM8(0x0149)
2828
#define DMA_CH3_SRCADDR2 _SFR_MEM8(0x014A)
2829
#define DMA_CH3_DESTADDR0 _SFR_MEM8(0x014C)
2830
#define DMA_CH3_DESTADDR1 _SFR_MEM8(0x014D)
2831
#define DMA_CH3_DESTADDR2 _SFR_MEM8(0x014E)
2833
/* EVSYS - Event System */
2834
#define EVSYS_CH0MUX _SFR_MEM8(0x0180)
2835
#define EVSYS_CH1MUX _SFR_MEM8(0x0181)
2836
#define EVSYS_CH2MUX _SFR_MEM8(0x0182)
2837
#define EVSYS_CH3MUX _SFR_MEM8(0x0183)
2838
#define EVSYS_CH4MUX _SFR_MEM8(0x0184)
2839
#define EVSYS_CH5MUX _SFR_MEM8(0x0185)
2840
#define EVSYS_CH6MUX _SFR_MEM8(0x0186)
2841
#define EVSYS_CH7MUX _SFR_MEM8(0x0187)
2842
#define EVSYS_CH0CTRL _SFR_MEM8(0x0188)
2843
#define EVSYS_CH1CTRL _SFR_MEM8(0x0189)
2844
#define EVSYS_CH2CTRL _SFR_MEM8(0x018A)
2845
#define EVSYS_CH3CTRL _SFR_MEM8(0x018B)
2846
#define EVSYS_CH4CTRL _SFR_MEM8(0x018C)
2847
#define EVSYS_CH5CTRL _SFR_MEM8(0x018D)
2848
#define EVSYS_CH6CTRL _SFR_MEM8(0x018E)
2849
#define EVSYS_CH7CTRL _SFR_MEM8(0x018F)
2850
#define EVSYS_STROBE _SFR_MEM8(0x0190)
2851
#define EVSYS_DATA _SFR_MEM8(0x0191)
2853
/* NVM - Non Volatile Memory Controller */
2854
#define NVM_ADDR0 _SFR_MEM8(0x01C0)
2855
#define NVM_ADDR1 _SFR_MEM8(0x01C1)
2856
#define NVM_ADDR2 _SFR_MEM8(0x01C2)
2857
#define NVM_DATA0 _SFR_MEM8(0x01C4)
2858
#define NVM_DATA1 _SFR_MEM8(0x01C5)
2859
#define NVM_DATA2 _SFR_MEM8(0x01C6)
2860
#define NVM_CMD _SFR_MEM8(0x01CA)
2861
#define NVM_CTRLA _SFR_MEM8(0x01CB)
2862
#define NVM_CTRLB _SFR_MEM8(0x01CC)
2863
#define NVM_INTCTRL _SFR_MEM8(0x01CD)
2864
#define NVM_STATUS _SFR_MEM8(0x01CF)
2865
#define NVM_LOCKBITS _SFR_MEM8(0x01D0)
2867
/* ADCA - Analog to Digital Converter A */
2868
#define ADCA_CTRLA _SFR_MEM8(0x0200)
2869
#define ADCA_CTRLB _SFR_MEM8(0x0201)
2870
#define ADCA_REFCTRL _SFR_MEM8(0x0202)
2871
#define ADCA_EVCTRL _SFR_MEM8(0x0203)
2872
#define ADCA_PRESCALER _SFR_MEM8(0x0204)
2873
#define ADCA_INTFLAGS _SFR_MEM8(0x0206)
2874
#define ADCA_CAL _SFR_MEM16(0x020C)
2875
#define ADCA_CH0RES _SFR_MEM16(0x0210)
2876
#define ADCA_CH1RES _SFR_MEM16(0x0212)
2877
#define ADCA_CH2RES _SFR_MEM16(0x0214)
2878
#define ADCA_CH3RES _SFR_MEM16(0x0216)
2879
#define ADCA_CMP _SFR_MEM16(0x0218)
2880
#define ADCA_CH0_CTRL _SFR_MEM8(0x0220)
2881
#define ADCA_CH0_MUXCTRL _SFR_MEM8(0x0221)
2882
#define ADCA_CH0_INTCTRL _SFR_MEM8(0x0222)
2883
#define ADCA_CH0_INTFLAGS _SFR_MEM8(0x0223)
2884
#define ADCA_CH0_RES _SFR_MEM16(0x0224)
2885
#define ADCA_CH1_CTRL _SFR_MEM8(0x0228)
2886
#define ADCA_CH1_MUXCTRL _SFR_MEM8(0x0229)
2887
#define ADCA_CH1_INTCTRL _SFR_MEM8(0x022A)
2888
#define ADCA_CH1_INTFLAGS _SFR_MEM8(0x022B)
2889
#define ADCA_CH1_RES _SFR_MEM16(0x022C)
2890
#define ADCA_CH2_CTRL _SFR_MEM8(0x0230)
2891
#define ADCA_CH2_MUXCTRL _SFR_MEM8(0x0231)
2892
#define ADCA_CH2_INTCTRL _SFR_MEM8(0x0232)
2893
#define ADCA_CH2_INTFLAGS _SFR_MEM8(0x0233)
2894
#define ADCA_CH2_RES _SFR_MEM16(0x0234)
2895
#define ADCA_CH3_CTRL _SFR_MEM8(0x0238)
2896
#define ADCA_CH3_MUXCTRL _SFR_MEM8(0x0239)
2897
#define ADCA_CH3_INTCTRL _SFR_MEM8(0x023A)
2898
#define ADCA_CH3_INTFLAGS _SFR_MEM8(0x023B)
2899
#define ADCA_CH3_RES _SFR_MEM16(0x023C)
2901
/* ADCB - Analog to Digital Converter B */
2902
#define ADCB_CTRLA _SFR_MEM8(0x0240)
2903
#define ADCB_CTRLB _SFR_MEM8(0x0241)
2904
#define ADCB_REFCTRL _SFR_MEM8(0x0242)
2905
#define ADCB_EVCTRL _SFR_MEM8(0x0243)
2906
#define ADCB_PRESCALER _SFR_MEM8(0x0244)
2907
#define ADCB_INTFLAGS _SFR_MEM8(0x0246)
2908
#define ADCB_CAL _SFR_MEM16(0x024C)
2909
#define ADCB_CH0RES _SFR_MEM16(0x0250)
2910
#define ADCB_CH1RES _SFR_MEM16(0x0252)
2911
#define ADCB_CH2RES _SFR_MEM16(0x0254)
2912
#define ADCB_CH3RES _SFR_MEM16(0x0256)
2913
#define ADCB_CMP _SFR_MEM16(0x0258)
2914
#define ADCB_CH0_CTRL _SFR_MEM8(0x0260)
2915
#define ADCB_CH0_MUXCTRL _SFR_MEM8(0x0261)
2916
#define ADCB_CH0_INTCTRL _SFR_MEM8(0x0262)
2917
#define ADCB_CH0_INTFLAGS _SFR_MEM8(0x0263)
2918
#define ADCB_CH0_RES _SFR_MEM16(0x0264)
2919
#define ADCB_CH1_CTRL _SFR_MEM8(0x0268)
2920
#define ADCB_CH1_MUXCTRL _SFR_MEM8(0x0269)
2921
#define ADCB_CH1_INTCTRL _SFR_MEM8(0x026A)
2922
#define ADCB_CH1_INTFLAGS _SFR_MEM8(0x026B)
2923
#define ADCB_CH1_RES _SFR_MEM16(0x026C)
2924
#define ADCB_CH2_CTRL _SFR_MEM8(0x0270)
2925
#define ADCB_CH2_MUXCTRL _SFR_MEM8(0x0271)
2926
#define ADCB_CH2_INTCTRL _SFR_MEM8(0x0272)
2927
#define ADCB_CH2_INTFLAGS _SFR_MEM8(0x0273)
2928
#define ADCB_CH2_RES _SFR_MEM16(0x0274)
2929
#define ADCB_CH3_CTRL _SFR_MEM8(0x0278)
2930
#define ADCB_CH3_MUXCTRL _SFR_MEM8(0x0279)
2931
#define ADCB_CH3_INTCTRL _SFR_MEM8(0x027A)
2932
#define ADCB_CH3_INTFLAGS _SFR_MEM8(0x027B)
2933
#define ADCB_CH3_RES _SFR_MEM16(0x027C)
2935
/* DACB - Digital to Analog Converter B */
2936
#define DACB_CTRLA _SFR_MEM8(0x0320)
2937
#define DACB_CTRLB _SFR_MEM8(0x0321)
2938
#define DACB_CTRLC _SFR_MEM8(0x0322)
2939
#define DACB_EVCTRL _SFR_MEM8(0x0323)
2940
#define DACB_TIMCTRL _SFR_MEM8(0x0324)
2941
#define DACB_STATUS _SFR_MEM8(0x0325)
2942
#define DACB_GAINCAL _SFR_MEM8(0x0328)
2943
#define DACB_OFFSETCAL _SFR_MEM8(0x0329)
2944
#define DACB_CH0DATA _SFR_MEM16(0x0338)
2945
#define DACB_CH1DATA _SFR_MEM16(0x033A)
2947
/* ACA - Analog Comparator A */
2948
#define ACA_AC0CTRL _SFR_MEM8(0x0380)
2949
#define ACA_AC1CTRL _SFR_MEM8(0x0381)
2950
#define ACA_AC0MUXCTRL _SFR_MEM8(0x0382)
2951
#define ACA_AC1MUXCTRL _SFR_MEM8(0x0383)
2952
#define ACA_CTRLA _SFR_MEM8(0x0384)
2953
#define ACA_CTRLB _SFR_MEM8(0x0385)
2954
#define ACA_WINCTRL _SFR_MEM8(0x0386)
2955
#define ACA_STATUS _SFR_MEM8(0x0387)
2957
/* ACB - Analog Comparator B */
2958
#define ACB_AC0CTRL _SFR_MEM8(0x0390)
2959
#define ACB_AC1CTRL _SFR_MEM8(0x0391)
2960
#define ACB_AC0MUXCTRL _SFR_MEM8(0x0392)
2961
#define ACB_AC1MUXCTRL _SFR_MEM8(0x0393)
2962
#define ACB_CTRLA _SFR_MEM8(0x0394)
2963
#define ACB_CTRLB _SFR_MEM8(0x0395)
2964
#define ACB_WINCTRL _SFR_MEM8(0x0396)
2965
#define ACB_STATUS _SFR_MEM8(0x0397)
2967
/* RTC - Real-Time Counter */
2968
#define RTC_CTRL _SFR_MEM8(0x0400)
2969
#define RTC_STATUS _SFR_MEM8(0x0401)
2970
#define RTC_INTCTRL _SFR_MEM8(0x0402)
2971
#define RTC_INTFLAGS _SFR_MEM8(0x0403)
2972
#define RTC_TEMP _SFR_MEM8(0x0404)
2973
#define RTC_CNT _SFR_MEM16(0x0408)
2974
#define RTC_PER _SFR_MEM16(0x040A)
2975
#define RTC_COMP _SFR_MEM16(0x040C)
2977
/* TWIC - Two-Wire Interface C */
2978
#define TWIC_CTRL _SFR_MEM8(0x0480)
2979
#define TWIC_MASTER_CTRLA _SFR_MEM8(0x0481)
2980
#define TWIC_MASTER_CTRLB _SFR_MEM8(0x0482)
2981
#define TWIC_MASTER_CTRLC _SFR_MEM8(0x0483)
2982
#define TWIC_MASTER_STATUS _SFR_MEM8(0x0484)
2983
#define TWIC_MASTER_BAUD _SFR_MEM8(0x0485)
2984
#define TWIC_MASTER_ADDR _SFR_MEM8(0x0486)
2985
#define TWIC_MASTER_DATA _SFR_MEM8(0x0487)
2986
#define TWIC_SLAVE_CTRLA _SFR_MEM8(0x0488)
2987
#define TWIC_SLAVE_CTRLB _SFR_MEM8(0x0489)
2988
#define TWIC_SLAVE_STATUS _SFR_MEM8(0x048A)
2989
#define TWIC_SLAVE_ADDR _SFR_MEM8(0x048B)
2990
#define TWIC_SLAVE_DATA _SFR_MEM8(0x048C)
2991
#define TWIC_SLAVE_ADDRMASK _SFR_MEM8(0x048D)
2993
/* TWIE - Two-Wire Interface E */
2994
#define TWIE_CTRL _SFR_MEM8(0x04A0)
2995
#define TWIE_MASTER_CTRLA _SFR_MEM8(0x04A1)
2996
#define TWIE_MASTER_CTRLB _SFR_MEM8(0x04A2)
2997
#define TWIE_MASTER_CTRLC _SFR_MEM8(0x04A3)
2998
#define TWIE_MASTER_STATUS _SFR_MEM8(0x04A4)
2999
#define TWIE_MASTER_BAUD _SFR_MEM8(0x04A5)
3000
#define TWIE_MASTER_ADDR _SFR_MEM8(0x04A6)
3001
#define TWIE_MASTER_DATA _SFR_MEM8(0x04A7)
3002
#define TWIE_SLAVE_CTRLA _SFR_MEM8(0x04A8)
3003
#define TWIE_SLAVE_CTRLB _SFR_MEM8(0x04A9)
3004
#define TWIE_SLAVE_STATUS _SFR_MEM8(0x04AA)
3005
#define TWIE_SLAVE_ADDR _SFR_MEM8(0x04AB)
3006
#define TWIE_SLAVE_DATA _SFR_MEM8(0x04AC)
3007
#define TWIE_SLAVE_ADDRMASK _SFR_MEM8(0x04AD)
3009
/* PORTA - Port A */
3010
#define PORTA_DIR _SFR_MEM8(0x0600)
3011
#define PORTA_DIRSET _SFR_MEM8(0x0601)
3012
#define PORTA_DIRCLR _SFR_MEM8(0x0602)
3013
#define PORTA_DIRTGL _SFR_MEM8(0x0603)
3014
#define PORTA_OUT _SFR_MEM8(0x0604)
3015
#define PORTA_OUTSET _SFR_MEM8(0x0605)
3016
#define PORTA_OUTCLR _SFR_MEM8(0x0606)
3017
#define PORTA_OUTTGL _SFR_MEM8(0x0607)
3018
#define PORTA_IN _SFR_MEM8(0x0608)
3019
#define PORTA_INTCTRL _SFR_MEM8(0x0609)
3020
#define PORTA_INT0MASK _SFR_MEM8(0x060A)
3021
#define PORTA_INT1MASK _SFR_MEM8(0x060B)
3022
#define PORTA_INTFLAGS _SFR_MEM8(0x060C)
3023
#define PORTA_PIN0CTRL _SFR_MEM8(0x0610)
3024
#define PORTA_PIN1CTRL _SFR_MEM8(0x0611)
3025
#define PORTA_PIN2CTRL _SFR_MEM8(0x0612)
3026
#define PORTA_PIN3CTRL _SFR_MEM8(0x0613)
3027
#define PORTA_PIN4CTRL _SFR_MEM8(0x0614)
3028
#define PORTA_PIN5CTRL _SFR_MEM8(0x0615)
3029
#define PORTA_PIN6CTRL _SFR_MEM8(0x0616)
3030
#define PORTA_PIN7CTRL _SFR_MEM8(0x0617)
3032
/* PORTB - Port B */
3033
#define PORTB_DIR _SFR_MEM8(0x0620)
3034
#define PORTB_DIRSET _SFR_MEM8(0x0621)
3035
#define PORTB_DIRCLR _SFR_MEM8(0x0622)
3036
#define PORTB_DIRTGL _SFR_MEM8(0x0623)
3037
#define PORTB_OUT _SFR_MEM8(0x0624)
3038
#define PORTB_OUTSET _SFR_MEM8(0x0625)
3039
#define PORTB_OUTCLR _SFR_MEM8(0x0626)
3040
#define PORTB_OUTTGL _SFR_MEM8(0x0627)
3041
#define PORTB_IN _SFR_MEM8(0x0628)
3042
#define PORTB_INTCTRL _SFR_MEM8(0x0629)
3043
#define PORTB_INT0MASK _SFR_MEM8(0x062A)
3044
#define PORTB_INT1MASK _SFR_MEM8(0x062B)
3045
#define PORTB_INTFLAGS _SFR_MEM8(0x062C)
3046
#define PORTB_PIN0CTRL _SFR_MEM8(0x0630)
3047
#define PORTB_PIN1CTRL _SFR_MEM8(0x0631)
3048
#define PORTB_PIN2CTRL _SFR_MEM8(0x0632)
3049
#define PORTB_PIN3CTRL _SFR_MEM8(0x0633)
3050
#define PORTB_PIN4CTRL _SFR_MEM8(0x0634)
3051
#define PORTB_PIN5CTRL _SFR_MEM8(0x0635)
3052
#define PORTB_PIN6CTRL _SFR_MEM8(0x0636)
3053
#define PORTB_PIN7CTRL _SFR_MEM8(0x0637)
3055
/* PORTC - Port C */
3056
#define PORTC_DIR _SFR_MEM8(0x0640)
3057
#define PORTC_DIRSET _SFR_MEM8(0x0641)
3058
#define PORTC_DIRCLR _SFR_MEM8(0x0642)
3059
#define PORTC_DIRTGL _SFR_MEM8(0x0643)
3060
#define PORTC_OUT _SFR_MEM8(0x0644)
3061
#define PORTC_OUTSET _SFR_MEM8(0x0645)
3062
#define PORTC_OUTCLR _SFR_MEM8(0x0646)
3063
#define PORTC_OUTTGL _SFR_MEM8(0x0647)
3064
#define PORTC_IN _SFR_MEM8(0x0648)
3065
#define PORTC_INTCTRL _SFR_MEM8(0x0649)
3066
#define PORTC_INT0MASK _SFR_MEM8(0x064A)
3067
#define PORTC_INT1MASK _SFR_MEM8(0x064B)
3068
#define PORTC_INTFLAGS _SFR_MEM8(0x064C)
3069
#define PORTC_PIN0CTRL _SFR_MEM8(0x0650)
3070
#define PORTC_PIN1CTRL _SFR_MEM8(0x0651)
3071
#define PORTC_PIN2CTRL _SFR_MEM8(0x0652)
3072
#define PORTC_PIN3CTRL _SFR_MEM8(0x0653)
3073
#define PORTC_PIN4CTRL _SFR_MEM8(0x0654)
3074
#define PORTC_PIN5CTRL _SFR_MEM8(0x0655)
3075
#define PORTC_PIN6CTRL _SFR_MEM8(0x0656)
3076
#define PORTC_PIN7CTRL _SFR_MEM8(0x0657)
3078
/* PORTD - Port D */
3079
#define PORTD_DIR _SFR_MEM8(0x0660)
3080
#define PORTD_DIRSET _SFR_MEM8(0x0661)
3081
#define PORTD_DIRCLR _SFR_MEM8(0x0662)
3082
#define PORTD_DIRTGL _SFR_MEM8(0x0663)
3083
#define PORTD_OUT _SFR_MEM8(0x0664)
3084
#define PORTD_OUTSET _SFR_MEM8(0x0665)
3085
#define PORTD_OUTCLR _SFR_MEM8(0x0666)
3086
#define PORTD_OUTTGL _SFR_MEM8(0x0667)
3087
#define PORTD_IN _SFR_MEM8(0x0668)
3088
#define PORTD_INTCTRL _SFR_MEM8(0x0669)
3089
#define PORTD_INT0MASK _SFR_MEM8(0x066A)
3090
#define PORTD_INT1MASK _SFR_MEM8(0x066B)
3091
#define PORTD_INTFLAGS _SFR_MEM8(0x066C)
3092
#define PORTD_PIN0CTRL _SFR_MEM8(0x0670)
3093
#define PORTD_PIN1CTRL _SFR_MEM8(0x0671)
3094
#define PORTD_PIN2CTRL _SFR_MEM8(0x0672)
3095
#define PORTD_PIN3CTRL _SFR_MEM8(0x0673)
3096
#define PORTD_PIN4CTRL _SFR_MEM8(0x0674)
3097
#define PORTD_PIN5CTRL _SFR_MEM8(0x0675)
3098
#define PORTD_PIN6CTRL _SFR_MEM8(0x0676)
3099
#define PORTD_PIN7CTRL _SFR_MEM8(0x0677)
3101
/* PORTE - Port E */
3102
#define PORTE_DIR _SFR_MEM8(0x0680)
3103
#define PORTE_DIRSET _SFR_MEM8(0x0681)
3104
#define PORTE_DIRCLR _SFR_MEM8(0x0682)
3105
#define PORTE_DIRTGL _SFR_MEM8(0x0683)
3106
#define PORTE_OUT _SFR_MEM8(0x0684)
3107
#define PORTE_OUTSET _SFR_MEM8(0x0685)
3108
#define PORTE_OUTCLR _SFR_MEM8(0x0686)
3109
#define PORTE_OUTTGL _SFR_MEM8(0x0687)
3110
#define PORTE_IN _SFR_MEM8(0x0688)
3111
#define PORTE_INTCTRL _SFR_MEM8(0x0689)
3112
#define PORTE_INT0MASK _SFR_MEM8(0x068A)
3113
#define PORTE_INT1MASK _SFR_MEM8(0x068B)
3114
#define PORTE_INTFLAGS _SFR_MEM8(0x068C)
3115
#define PORTE_PIN0CTRL _SFR_MEM8(0x0690)
3116
#define PORTE_PIN1CTRL _SFR_MEM8(0x0691)
3117
#define PORTE_PIN2CTRL _SFR_MEM8(0x0692)
3118
#define PORTE_PIN3CTRL _SFR_MEM8(0x0693)
3119
#define PORTE_PIN4CTRL _SFR_MEM8(0x0694)
3120
#define PORTE_PIN5CTRL _SFR_MEM8(0x0695)
3121
#define PORTE_PIN6CTRL _SFR_MEM8(0x0696)
3122
#define PORTE_PIN7CTRL _SFR_MEM8(0x0697)
3124
/* PORTF - Port F */
3125
#define PORTF_DIR _SFR_MEM8(0x06A0)
3126
#define PORTF_DIRSET _SFR_MEM8(0x06A1)
3127
#define PORTF_DIRCLR _SFR_MEM8(0x06A2)
3128
#define PORTF_DIRTGL _SFR_MEM8(0x06A3)
3129
#define PORTF_OUT _SFR_MEM8(0x06A4)
3130
#define PORTF_OUTSET _SFR_MEM8(0x06A5)
3131
#define PORTF_OUTCLR _SFR_MEM8(0x06A6)
3132
#define PORTF_OUTTGL _SFR_MEM8(0x06A7)
3133
#define PORTF_IN _SFR_MEM8(0x06A8)
3134
#define PORTF_INTCTRL _SFR_MEM8(0x06A9)
3135
#define PORTF_INT0MASK _SFR_MEM8(0x06AA)
3136
#define PORTF_INT1MASK _SFR_MEM8(0x06AB)
3137
#define PORTF_INTFLAGS _SFR_MEM8(0x06AC)
3138
#define PORTF_PIN0CTRL _SFR_MEM8(0x06B0)
3139
#define PORTF_PIN1CTRL _SFR_MEM8(0x06B1)
3140
#define PORTF_PIN2CTRL _SFR_MEM8(0x06B2)
3141
#define PORTF_PIN3CTRL _SFR_MEM8(0x06B3)
3142
#define PORTF_PIN4CTRL _SFR_MEM8(0x06B4)
3143
#define PORTF_PIN5CTRL _SFR_MEM8(0x06B5)
3144
#define PORTF_PIN6CTRL _SFR_MEM8(0x06B6)
3145
#define PORTF_PIN7CTRL _SFR_MEM8(0x06B7)
3147
/* PORTR - Port R */
3148
#define PORTR_DIR _SFR_MEM8(0x07E0)
3149
#define PORTR_DIRSET _SFR_MEM8(0x07E1)
3150
#define PORTR_DIRCLR _SFR_MEM8(0x07E2)
3151
#define PORTR_DIRTGL _SFR_MEM8(0x07E3)
3152
#define PORTR_OUT _SFR_MEM8(0x07E4)
3153
#define PORTR_OUTSET _SFR_MEM8(0x07E5)
3154
#define PORTR_OUTCLR _SFR_MEM8(0x07E6)
3155
#define PORTR_OUTTGL _SFR_MEM8(0x07E7)
3156
#define PORTR_IN _SFR_MEM8(0x07E8)
3157
#define PORTR_INTCTRL _SFR_MEM8(0x07E9)
3158
#define PORTR_INT0MASK _SFR_MEM8(0x07EA)
3159
#define PORTR_INT1MASK _SFR_MEM8(0x07EB)
3160
#define PORTR_INTFLAGS _SFR_MEM8(0x07EC)
3161
#define PORTR_PIN0CTRL _SFR_MEM8(0x07F0)
3162
#define PORTR_PIN1CTRL _SFR_MEM8(0x07F1)
3163
#define PORTR_PIN2CTRL _SFR_MEM8(0x07F2)
3164
#define PORTR_PIN3CTRL _SFR_MEM8(0x07F3)
3165
#define PORTR_PIN4CTRL _SFR_MEM8(0x07F4)
3166
#define PORTR_PIN5CTRL _SFR_MEM8(0x07F5)
3167
#define PORTR_PIN6CTRL _SFR_MEM8(0x07F6)
3168
#define PORTR_PIN7CTRL _SFR_MEM8(0x07F7)
3170
/* TCC0 - Timer/Counter C0 */
3171
#define TCC0_CTRLA _SFR_MEM8(0x0800)
3172
#define TCC0_CTRLB _SFR_MEM8(0x0801)
3173
#define TCC0_CTRLC _SFR_MEM8(0x0802)
3174
#define TCC0_CTRLD _SFR_MEM8(0x0803)
3175
#define TCC0_CTRLE _SFR_MEM8(0x0804)
3176
#define TCC0_INTCTRLA _SFR_MEM8(0x0806)
3177
#define TCC0_INTCTRLB _SFR_MEM8(0x0807)
3178
#define TCC0_CTRLFCLR _SFR_MEM8(0x0808)
3179
#define TCC0_CTRLFSET _SFR_MEM8(0x0809)
3180
#define TCC0_CTRLGCLR _SFR_MEM8(0x080A)
3181
#define TCC0_CTRLGSET _SFR_MEM8(0x080B)
3182
#define TCC0_INTFLAGS _SFR_MEM8(0x080C)
3183
#define TCC0_TEMP _SFR_MEM8(0x080F)
3184
#define TCC0_CNT _SFR_MEM16(0x0820)
3185
#define TCC0_PER _SFR_MEM16(0x0826)
3186
#define TCC0_CCA _SFR_MEM16(0x0828)
3187
#define TCC0_CCB _SFR_MEM16(0x082A)
3188
#define TCC0_CCC _SFR_MEM16(0x082C)
3189
#define TCC0_CCD _SFR_MEM16(0x082E)
3190
#define TCC0_PERBUF _SFR_MEM16(0x0836)
3191
#define TCC0_CCABUF _SFR_MEM16(0x0838)
3192
#define TCC0_CCBBUF _SFR_MEM16(0x083A)
3193
#define TCC0_CCCBUF _SFR_MEM16(0x083C)
3194
#define TCC0_CCDBUF _SFR_MEM16(0x083E)
3196
/* TCC1 - Timer/Counter C1 */
3197
#define TCC1_CTRLA _SFR_MEM8(0x0840)
3198
#define TCC1_CTRLB _SFR_MEM8(0x0841)
3199
#define TCC1_CTRLC _SFR_MEM8(0x0842)
3200
#define TCC1_CTRLD _SFR_MEM8(0x0843)
3201
#define TCC1_CTRLE _SFR_MEM8(0x0844)
3202
#define TCC1_INTCTRLA _SFR_MEM8(0x0846)
3203
#define TCC1_INTCTRLB _SFR_MEM8(0x0847)
3204
#define TCC1_CTRLFCLR _SFR_MEM8(0x0848)
3205
#define TCC1_CTRLFSET _SFR_MEM8(0x0849)
3206
#define TCC1_CTRLGCLR _SFR_MEM8(0x084A)
3207
#define TCC1_CTRLGSET _SFR_MEM8(0x084B)
3208
#define TCC1_INTFLAGS _SFR_MEM8(0x084C)
3209
#define TCC1_TEMP _SFR_MEM8(0x084F)
3210
#define TCC1_CNT _SFR_MEM16(0x0860)
3211
#define TCC1_PER _SFR_MEM16(0x0866)
3212
#define TCC1_CCA _SFR_MEM16(0x0868)
3213
#define TCC1_CCB _SFR_MEM16(0x086A)
3214
#define TCC1_PERBUF _SFR_MEM16(0x0876)
3215
#define TCC1_CCABUF _SFR_MEM16(0x0878)
3216
#define TCC1_CCBBUF _SFR_MEM16(0x087A)
3218
/* AWEXC - Advanced Waveform Extension C */
3219
#define AWEXC_CTRL _SFR_MEM8(0x0880)
3220
#define AWEXC_FDEMASK _SFR_MEM8(0x0882)
3221
#define AWEXC_FDCTRL _SFR_MEM8(0x0883)
3222
#define AWEXC_STATUS _SFR_MEM8(0x0884)
3223
#define AWEXC_DTBOTH _SFR_MEM8(0x0886)
3224
#define AWEXC_DTBOTHBUF _SFR_MEM8(0x0887)
3225
#define AWEXC_DTLS _SFR_MEM8(0x0888)
3226
#define AWEXC_DTHS _SFR_MEM8(0x0889)
3227
#define AWEXC_DTLSBUF _SFR_MEM8(0x088A)
3228
#define AWEXC_DTHSBUF _SFR_MEM8(0x088B)
3229
#define AWEXC_OUTOVEN _SFR_MEM8(0x088C)
3231
/* HIRESC - High-Resolution Extension C */
3232
#define HIRESC_CTRLA _SFR_MEM8(0x0890)
3234
/* USARTC0 - Universal Asynchronous Receiver-Transmitter C0 */
3235
#define USARTC0_DATA _SFR_MEM8(0x08A0)
3236
#define USARTC0_STATUS _SFR_MEM8(0x08A1)
3237
#define USARTC0_CTRLA _SFR_MEM8(0x08A3)
3238
#define USARTC0_CTRLB _SFR_MEM8(0x08A4)
3239
#define USARTC0_CTRLC _SFR_MEM8(0x08A5)
3240
#define USARTC0_BAUDCTRLA _SFR_MEM8(0x08A6)
3241
#define USARTC0_BAUDCTRLB _SFR_MEM8(0x08A7)
3243
/* USARTC1 - Universal Asynchronous Receiver-Transmitter C1 */
3244
#define USARTC1_DATA _SFR_MEM8(0x08B0)
3245
#define USARTC1_STATUS _SFR_MEM8(0x08B1)
3246
#define USARTC1_CTRLA _SFR_MEM8(0x08B3)
3247
#define USARTC1_CTRLB _SFR_MEM8(0x08B4)
3248
#define USARTC1_CTRLC _SFR_MEM8(0x08B5)
3249
#define USARTC1_BAUDCTRLA _SFR_MEM8(0x08B6)
3250
#define USARTC1_BAUDCTRLB _SFR_MEM8(0x08B7)
3252
/* SPIC - Serial Peripheral Interface C */
3253
#define SPIC_CTRL _SFR_MEM8(0x08C0)
3254
#define SPIC_INTCTRL _SFR_MEM8(0x08C1)
3255
#define SPIC_STATUS _SFR_MEM8(0x08C2)
3256
#define SPIC_DATA _SFR_MEM8(0x08C3)
3258
/* IRCOM - IR Communication Module */
3259
#define IRCOM_CTRL _SFR_MEM8(0x08F8)
3260
#define IRCOM_TXPLCTRL _SFR_MEM8(0x08F9)
3261
#define IRCOM_RXPLCTRL _SFR_MEM8(0x08FA)
3263
/* TCD0 - Timer/Counter D0 */
3264
#define TCD0_CTRLA _SFR_MEM8(0x0900)
3265
#define TCD0_CTRLB _SFR_MEM8(0x0901)
3266
#define TCD0_CTRLC _SFR_MEM8(0x0902)
3267
#define TCD0_CTRLD _SFR_MEM8(0x0903)
3268
#define TCD0_CTRLE _SFR_MEM8(0x0904)
3269
#define TCD0_INTCTRLA _SFR_MEM8(0x0906)
3270
#define TCD0_INTCTRLB _SFR_MEM8(0x0907)
3271
#define TCD0_CTRLFCLR _SFR_MEM8(0x0908)
3272
#define TCD0_CTRLFSET _SFR_MEM8(0x0909)
3273
#define TCD0_CTRLGCLR _SFR_MEM8(0x090A)
3274
#define TCD0_CTRLGSET _SFR_MEM8(0x090B)
3275
#define TCD0_INTFLAGS _SFR_MEM8(0x090C)
3276
#define TCD0_TEMP _SFR_MEM8(0x090F)
3277
#define TCD0_CNT _SFR_MEM16(0x0920)
3278
#define TCD0_PER _SFR_MEM16(0x0926)
3279
#define TCD0_CCA _SFR_MEM16(0x0928)
3280
#define TCD0_CCB _SFR_MEM16(0x092A)
3281
#define TCD0_CCC _SFR_MEM16(0x092C)
3282
#define TCD0_CCD _SFR_MEM16(0x092E)
3283
#define TCD0_PERBUF _SFR_MEM16(0x0936)
3284
#define TCD0_CCABUF _SFR_MEM16(0x0938)
3285
#define TCD0_CCBBUF _SFR_MEM16(0x093A)
3286
#define TCD0_CCCBUF _SFR_MEM16(0x093C)
3287
#define TCD0_CCDBUF _SFR_MEM16(0x093E)
3289
/* TCD1 - Timer/Counter D1 */
3290
#define TCD1_CTRLA _SFR_MEM8(0x0940)
3291
#define TCD1_CTRLB _SFR_MEM8(0x0941)
3292
#define TCD1_CTRLC _SFR_MEM8(0x0942)
3293
#define TCD1_CTRLD _SFR_MEM8(0x0943)
3294
#define TCD1_CTRLE _SFR_MEM8(0x0944)
3295
#define TCD1_INTCTRLA _SFR_MEM8(0x0946)
3296
#define TCD1_INTCTRLB _SFR_MEM8(0x0947)
3297
#define TCD1_CTRLFCLR _SFR_MEM8(0x0948)
3298
#define TCD1_CTRLFSET _SFR_MEM8(0x0949)
3299
#define TCD1_CTRLGCLR _SFR_MEM8(0x094A)
3300
#define TCD1_CTRLGSET _SFR_MEM8(0x094B)
3301
#define TCD1_INTFLAGS _SFR_MEM8(0x094C)
3302
#define TCD1_TEMP _SFR_MEM8(0x094F)
3303
#define TCD1_CNT _SFR_MEM16(0x0960)
3304
#define TCD1_PER _SFR_MEM16(0x0966)
3305
#define TCD1_CCA _SFR_MEM16(0x0968)
3306
#define TCD1_CCB _SFR_MEM16(0x096A)
3307
#define TCD1_PERBUF _SFR_MEM16(0x0976)
3308
#define TCD1_CCABUF _SFR_MEM16(0x0978)
3309
#define TCD1_CCBBUF _SFR_MEM16(0x097A)
3311
/* HIRESD - High-Resolution Extension D */
3312
#define HIRESD_CTRLA _SFR_MEM8(0x0990)
3314
/* USARTD0 - Universal Asynchronous Receiver-Transmitter D0 */
3315
#define USARTD0_DATA _SFR_MEM8(0x09A0)
3316
#define USARTD0_STATUS _SFR_MEM8(0x09A1)
3317
#define USARTD0_CTRLA _SFR_MEM8(0x09A3)
3318
#define USARTD0_CTRLB _SFR_MEM8(0x09A4)
3319
#define USARTD0_CTRLC _SFR_MEM8(0x09A5)
3320
#define USARTD0_BAUDCTRLA _SFR_MEM8(0x09A6)
3321
#define USARTD0_BAUDCTRLB _SFR_MEM8(0x09A7)
3323
/* USARTD1 - Universal Asynchronous Receiver-Transmitter D1 */
3324
#define USARTD1_DATA _SFR_MEM8(0x09B0)
3325
#define USARTD1_STATUS _SFR_MEM8(0x09B1)
3326
#define USARTD1_CTRLA _SFR_MEM8(0x09B3)
3327
#define USARTD1_CTRLB _SFR_MEM8(0x09B4)
3328
#define USARTD1_CTRLC _SFR_MEM8(0x09B5)
3329
#define USARTD1_BAUDCTRLA _SFR_MEM8(0x09B6)
3330
#define USARTD1_BAUDCTRLB _SFR_MEM8(0x09B7)
3332
/* SPID - Serial Peripheral Interface D */
3333
#define SPID_CTRL _SFR_MEM8(0x09C0)
3334
#define SPID_INTCTRL _SFR_MEM8(0x09C1)
3335
#define SPID_STATUS _SFR_MEM8(0x09C2)
3336
#define SPID_DATA _SFR_MEM8(0x09C3)
3338
/* TCE0 - Timer/Counter E0 */
3339
#define TCE0_CTRLA _SFR_MEM8(0x0A00)
3340
#define TCE0_CTRLB _SFR_MEM8(0x0A01)
3341
#define TCE0_CTRLC _SFR_MEM8(0x0A02)
3342
#define TCE0_CTRLD _SFR_MEM8(0x0A03)
3343
#define TCE0_CTRLE _SFR_MEM8(0x0A04)
3344
#define TCE0_INTCTRLA _SFR_MEM8(0x0A06)
3345
#define TCE0_INTCTRLB _SFR_MEM8(0x0A07)
3346
#define TCE0_CTRLFCLR _SFR_MEM8(0x0A08)
3347
#define TCE0_CTRLFSET _SFR_MEM8(0x0A09)
3348
#define TCE0_CTRLGCLR _SFR_MEM8(0x0A0A)
3349
#define TCE0_CTRLGSET _SFR_MEM8(0x0A0B)
3350
#define TCE0_INTFLAGS _SFR_MEM8(0x0A0C)
3351
#define TCE0_TEMP _SFR_MEM8(0x0A0F)
3352
#define TCE0_CNT _SFR_MEM16(0x0A20)
3353
#define TCE0_PER _SFR_MEM16(0x0A26)
3354
#define TCE0_CCA _SFR_MEM16(0x0A28)
3355
#define TCE0_CCB _SFR_MEM16(0x0A2A)
3356
#define TCE0_CCC _SFR_MEM16(0x0A2C)
3357
#define TCE0_CCD _SFR_MEM16(0x0A2E)
3358
#define TCE0_PERBUF _SFR_MEM16(0x0A36)
3359
#define TCE0_CCABUF _SFR_MEM16(0x0A38)
3360
#define TCE0_CCBBUF _SFR_MEM16(0x0A3A)
3361
#define TCE0_CCCBUF _SFR_MEM16(0x0A3C)
3362
#define TCE0_CCDBUF _SFR_MEM16(0x0A3E)
3364
/* TCE1 - Timer/Counter E1 */
3365
#define TCE1_CTRLA _SFR_MEM8(0x0A40)
3366
#define TCE1_CTRLB _SFR_MEM8(0x0A41)
3367
#define TCE1_CTRLC _SFR_MEM8(0x0A42)
3368
#define TCE1_CTRLD _SFR_MEM8(0x0A43)
3369
#define TCE1_CTRLE _SFR_MEM8(0x0A44)
3370
#define TCE1_INTCTRLA _SFR_MEM8(0x0A46)
3371
#define TCE1_INTCTRLB _SFR_MEM8(0x0A47)
3372
#define TCE1_CTRLFCLR _SFR_MEM8(0x0A48)
3373
#define TCE1_CTRLFSET _SFR_MEM8(0x0A49)
3374
#define TCE1_CTRLGCLR _SFR_MEM8(0x0A4A)
3375
#define TCE1_CTRLGSET _SFR_MEM8(0x0A4B)
3376
#define TCE1_INTFLAGS _SFR_MEM8(0x0A4C)
3377
#define TCE1_TEMP _SFR_MEM8(0x0A4F)
3378
#define TCE1_CNT _SFR_MEM16(0x0A60)
3379
#define TCE1_PER _SFR_MEM16(0x0A66)
3380
#define TCE1_CCA _SFR_MEM16(0x0A68)
3381
#define TCE1_CCB _SFR_MEM16(0x0A6A)
3382
#define TCE1_PERBUF _SFR_MEM16(0x0A76)
3383
#define TCE1_CCABUF _SFR_MEM16(0x0A78)
3384
#define TCE1_CCBBUF _SFR_MEM16(0x0A7A)
3386
/* AWEXE - Advanced Waveform Extension E */
3387
#define AWEXE_CTRL _SFR_MEM8(0x0A80)
3388
#define AWEXE_FDEMASK _SFR_MEM8(0x0A82)
3389
#define AWEXE_FDCTRL _SFR_MEM8(0x0A83)
3390
#define AWEXE_STATUS _SFR_MEM8(0x0A84)
3391
#define AWEXE_DTBOTH _SFR_MEM8(0x0A86)
3392
#define AWEXE_DTBOTHBUF _SFR_MEM8(0x0A87)
3393
#define AWEXE_DTLS _SFR_MEM8(0x0A88)
3394
#define AWEXE_DTHS _SFR_MEM8(0x0A89)
3395
#define AWEXE_DTLSBUF _SFR_MEM8(0x0A8A)
3396
#define AWEXE_DTHSBUF _SFR_MEM8(0x0A8B)
3397
#define AWEXE_OUTOVEN _SFR_MEM8(0x0A8C)
3399
/* HIRESE - High-Resolution Extension E */
3400
#define HIRESE_CTRLA _SFR_MEM8(0x0A90)
3402
/* USARTE0 - Universal Asynchronous Receiver-Transmitter E0 */
3403
#define USARTE0_DATA _SFR_MEM8(0x0AA0)
3404
#define USARTE0_STATUS _SFR_MEM8(0x0AA1)
3405
#define USARTE0_CTRLA _SFR_MEM8(0x0AA3)
3406
#define USARTE0_CTRLB _SFR_MEM8(0x0AA4)
3407
#define USARTE0_CTRLC _SFR_MEM8(0x0AA5)
3408
#define USARTE0_BAUDCTRLA _SFR_MEM8(0x0AA6)
3409
#define USARTE0_BAUDCTRLB _SFR_MEM8(0x0AA7)
3411
/* USARTE1 - Universal Asynchronous Receiver-Transmitter E1 */
3412
#define USARTE1_DATA _SFR_MEM8(0x0AB0)
3413
#define USARTE1_STATUS _SFR_MEM8(0x0AB1)
3414
#define USARTE1_CTRLA _SFR_MEM8(0x0AB3)
3415
#define USARTE1_CTRLB _SFR_MEM8(0x0AB4)
3416
#define USARTE1_CTRLC _SFR_MEM8(0x0AB5)
3417
#define USARTE1_BAUDCTRLA _SFR_MEM8(0x0AB6)
3418
#define USARTE1_BAUDCTRLB _SFR_MEM8(0x0AB7)
3420
/* SPIE - Serial Peripheral Interface E */
3421
#define SPIE_CTRL _SFR_MEM8(0x0AC0)
3422
#define SPIE_INTCTRL _SFR_MEM8(0x0AC1)
3423
#define SPIE_STATUS _SFR_MEM8(0x0AC2)
3424
#define SPIE_DATA _SFR_MEM8(0x0AC3)
3426
/* TCF0 - Timer/Counter F0 */
3427
#define TCF0_CTRLA _SFR_MEM8(0x0B00)
3428
#define TCF0_CTRLB _SFR_MEM8(0x0B01)
3429
#define TCF0_CTRLC _SFR_MEM8(0x0B02)
3430
#define TCF0_CTRLD _SFR_MEM8(0x0B03)
3431
#define TCF0_CTRLE _SFR_MEM8(0x0B04)
3432
#define TCF0_INTCTRLA _SFR_MEM8(0x0B06)
3433
#define TCF0_INTCTRLB _SFR_MEM8(0x0B07)
3434
#define TCF0_CTRLFCLR _SFR_MEM8(0x0B08)
3435
#define TCF0_CTRLFSET _SFR_MEM8(0x0B09)
3436
#define TCF0_CTRLGCLR _SFR_MEM8(0x0B0A)
3437
#define TCF0_CTRLGSET _SFR_MEM8(0x0B0B)
3438
#define TCF0_INTFLAGS _SFR_MEM8(0x0B0C)
3439
#define TCF0_TEMP _SFR_MEM8(0x0B0F)
3440
#define TCF0_CNT _SFR_MEM16(0x0B20)
3441
#define TCF0_PER _SFR_MEM16(0x0B26)
3442
#define TCF0_CCA _SFR_MEM16(0x0B28)
3443
#define TCF0_CCB _SFR_MEM16(0x0B2A)
3444
#define TCF0_CCC _SFR_MEM16(0x0B2C)
3445
#define TCF0_CCD _SFR_MEM16(0x0B2E)
3446
#define TCF0_PERBUF _SFR_MEM16(0x0B36)
3447
#define TCF0_CCABUF _SFR_MEM16(0x0B38)
3448
#define TCF0_CCBBUF _SFR_MEM16(0x0B3A)
3449
#define TCF0_CCCBUF _SFR_MEM16(0x0B3C)
3450
#define TCF0_CCDBUF _SFR_MEM16(0x0B3E)
3452
/* HIRESF - High-Resolution Extension F */
3453
#define HIRESF_CTRLA _SFR_MEM8(0x0B90)
3455
/* USARTF0 - Universal Asynchronous Receiver-Transmitter F0 */
3456
#define USARTF0_DATA _SFR_MEM8(0x0BA0)
3457
#define USARTF0_STATUS _SFR_MEM8(0x0BA1)
3458
#define USARTF0_CTRLA _SFR_MEM8(0x0BA3)
3459
#define USARTF0_CTRLB _SFR_MEM8(0x0BA4)
3460
#define USARTF0_CTRLC _SFR_MEM8(0x0BA5)
3461
#define USARTF0_BAUDCTRLA _SFR_MEM8(0x0BA6)
3462
#define USARTF0_BAUDCTRLB _SFR_MEM8(0x0BA7)
3464
/* USARTF1 - Universal Asynchronous Receiver-Transmitter F1 */
3465
#define USARTF1_DATA _SFR_MEM8(0x0BB0)
3466
#define USARTF1_STATUS _SFR_MEM8(0x0BB1)
3467
#define USARTF1_CTRLA _SFR_MEM8(0x0BB3)
3468
#define USARTF1_CTRLB _SFR_MEM8(0x0BB4)
3469
#define USARTF1_CTRLC _SFR_MEM8(0x0BB5)
3470
#define USARTF1_BAUDCTRLA _SFR_MEM8(0x0BB6)
3471
#define USARTF1_BAUDCTRLB _SFR_MEM8(0x0BB7)
3473
/* SPIF - Serial Peripheral Interface F */
3474
#define SPIF_CTRL _SFR_MEM8(0x0BC0)
3475
#define SPIF_INTCTRL _SFR_MEM8(0x0BC1)
3476
#define SPIF_STATUS _SFR_MEM8(0x0BC2)
3477
#define SPIF_DATA _SFR_MEM8(0x0BC3)
3481
/*================== Bitfield Definitions ================== */
3483
/* XOCD - On-Chip Debug System */
3484
/* OCD.OCDR1 bit masks and bit positions */
3485
#define OCD_OCDRD_bm 0x01 /* OCDR Dirty bit mask. */
3486
#define OCD_OCDRD_bp 0 /* OCDR Dirty bit position. */
3490
/* CPU.CCP bit masks and bit positions */
3491
#define CPU_CCP_gm 0xFF /* CCP signature group mask. */
3492
#define CPU_CCP_gp 0 /* CCP signature group position. */
3493
#define CPU_CCP0_bm (1<<0) /* CCP signature bit 0 mask. */
3494
#define CPU_CCP0_bp 0 /* CCP signature bit 0 position. */
3495
#define CPU_CCP1_bm (1<<1) /* CCP signature bit 1 mask. */
3496
#define CPU_CCP1_bp 1 /* CCP signature bit 1 position. */
3497
#define CPU_CCP2_bm (1<<2) /* CCP signature bit 2 mask. */
3498
#define CPU_CCP2_bp 2 /* CCP signature bit 2 position. */
3499
#define CPU_CCP3_bm (1<<3) /* CCP signature bit 3 mask. */
3500
#define CPU_CCP3_bp 3 /* CCP signature bit 3 position. */
3501
#define CPU_CCP4_bm (1<<4) /* CCP signature bit 4 mask. */
3502
#define CPU_CCP4_bp 4 /* CCP signature bit 4 position. */
3503
#define CPU_CCP5_bm (1<<5) /* CCP signature bit 5 mask. */
3504
#define CPU_CCP5_bp 5 /* CCP signature bit 5 position. */
3505
#define CPU_CCP6_bm (1<<6) /* CCP signature bit 6 mask. */
3506
#define CPU_CCP6_bp 6 /* CCP signature bit 6 position. */
3507
#define CPU_CCP7_bm (1<<7) /* CCP signature bit 7 mask. */
3508
#define CPU_CCP7_bp 7 /* CCP signature bit 7 position. */
3511
/* CPU.SREG bit masks and bit positions */
3512
#define CPU_I_bm 0x80 /* Global Interrupt Enable Flag bit mask. */
3513
#define CPU_I_bp 7 /* Global Interrupt Enable Flag bit position. */
3515
#define CPU_T_bm 0x40 /* Transfer Bit bit mask. */
3516
#define CPU_T_bp 6 /* Transfer Bit bit position. */
3518
#define CPU_H_bm 0x20 /* Half Carry Flag bit mask. */
3519
#define CPU_H_bp 5 /* Half Carry Flag bit position. */
3521
#define CPU_S_bm 0x10 /* N Exclusive Or V Flag bit mask. */
3522
#define CPU_S_bp 4 /* N Exclusive Or V Flag bit position. */
3524
#define CPU_V_bm 0x08 /* Two's Complement Overflow Flag bit mask. */
3525
#define CPU_V_bp 3 /* Two's Complement Overflow Flag bit position. */
3527
#define CPU_N_bm 0x04 /* Negative Flag bit mask. */
3528
#define CPU_N_bp 2 /* Negative Flag bit position. */
3530
#define CPU_Z_bm 0x02 /* Zero Flag bit mask. */
3531
#define CPU_Z_bp 1 /* Zero Flag bit position. */
3533
#define CPU_C_bm 0x01 /* Carry Flag bit mask. */
3534
#define CPU_C_bp 0 /* Carry Flag bit position. */
3537
/* CLK - Clock System */
3538
/* CLK.CTRL bit masks and bit positions */
3539
#define CLK_SCLKSEL_gm 0x07 /* System Clock Selection group mask. */
3540
#define CLK_SCLKSEL_gp 0 /* System Clock Selection group position. */
3541
#define CLK_SCLKSEL0_bm (1<<0) /* System Clock Selection bit 0 mask. */
3542
#define CLK_SCLKSEL0_bp 0 /* System Clock Selection bit 0 position. */
3543
#define CLK_SCLKSEL1_bm (1<<1) /* System Clock Selection bit 1 mask. */
3544
#define CLK_SCLKSEL1_bp 1 /* System Clock Selection bit 1 position. */
3545
#define CLK_SCLKSEL2_bm (1<<2) /* System Clock Selection bit 2 mask. */
3546
#define CLK_SCLKSEL2_bp 2 /* System Clock Selection bit 2 position. */
3549
/* CLK.PSCTRL bit masks and bit positions */
3550
#define CLK_PSADIV_gm 0x7C /* Prescaler A Division Factor group mask. */
3551
#define CLK_PSADIV_gp 2 /* Prescaler A Division Factor group position. */
3552
#define CLK_PSADIV0_bm (1<<2) /* Prescaler A Division Factor bit 0 mask. */
3553
#define CLK_PSADIV0_bp 2 /* Prescaler A Division Factor bit 0 position. */
3554
#define CLK_PSADIV1_bm (1<<3) /* Prescaler A Division Factor bit 1 mask. */
3555
#define CLK_PSADIV1_bp 3 /* Prescaler A Division Factor bit 1 position. */
3556
#define CLK_PSADIV2_bm (1<<4) /* Prescaler A Division Factor bit 2 mask. */
3557
#define CLK_PSADIV2_bp 4 /* Prescaler A Division Factor bit 2 position. */
3558
#define CLK_PSADIV3_bm (1<<5) /* Prescaler A Division Factor bit 3 mask. */
3559
#define CLK_PSADIV3_bp 5 /* Prescaler A Division Factor bit 3 position. */
3560
#define CLK_PSADIV4_bm (1<<6) /* Prescaler A Division Factor bit 4 mask. */
3561
#define CLK_PSADIV4_bp 6 /* Prescaler A Division Factor bit 4 position. */
3563
#define CLK_PSBCDIV_gm 0x03 /* Prescaler B and C Division factor group mask. */
3564
#define CLK_PSBCDIV_gp 0 /* Prescaler B and C Division factor group position. */
3565
#define CLK_PSBCDIV0_bm (1<<0) /* Prescaler B and C Division factor bit 0 mask. */
3566
#define CLK_PSBCDIV0_bp 0 /* Prescaler B and C Division factor bit 0 position. */
3567
#define CLK_PSBCDIV1_bm (1<<1) /* Prescaler B and C Division factor bit 1 mask. */
3568
#define CLK_PSBCDIV1_bp 1 /* Prescaler B and C Division factor bit 1 position. */
3571
/* CLK.LOCK bit masks and bit positions */
3572
#define CLK_LOCK_bm 0x01 /* Clock System Lock bit mask. */
3573
#define CLK_LOCK_bp 0 /* Clock System Lock bit position. */
3576
/* CLK.RTCCTRL bit masks and bit positions */
3577
#define CLK_RTCSRC_gm 0x0E /* Clock Source group mask. */
3578
#define CLK_RTCSRC_gp 1 /* Clock Source group position. */
3579
#define CLK_RTCSRC0_bm (1<<1) /* Clock Source bit 0 mask. */
3580
#define CLK_RTCSRC0_bp 1 /* Clock Source bit 0 position. */
3581
#define CLK_RTCSRC1_bm (1<<2) /* Clock Source bit 1 mask. */
3582
#define CLK_RTCSRC1_bp 2 /* Clock Source bit 1 position. */
3583
#define CLK_RTCSRC2_bm (1<<3) /* Clock Source bit 2 mask. */
3584
#define CLK_RTCSRC2_bp 3 /* Clock Source bit 2 position. */
3586
#define CLK_RTCEN_bm 0x01 /* RTC Clock Source Enable bit mask. */
3587
#define CLK_RTCEN_bp 0 /* RTC Clock Source Enable bit position. */
3590
/* PR.PRGEN bit masks and bit positions */
3591
#define PR_AES_bm 0x10 /* AES bit mask. */
3592
#define PR_AES_bp 4 /* AES bit position. */
3594
#define PR_EBI_bm 0x08 /* External Bus Interface bit mask. */
3595
#define PR_EBI_bp 3 /* External Bus Interface bit position. */
3597
#define PR_RTC_bm 0x04 /* Real-time Counter bit mask. */
3598
#define PR_RTC_bp 2 /* Real-time Counter bit position. */
3600
#define PR_EVSYS_bm 0x02 /* Event System bit mask. */
3601
#define PR_EVSYS_bp 1 /* Event System bit position. */
3603
#define PR_DMA_bm 0x01 /* DMA-Controller bit mask. */
3604
#define PR_DMA_bp 0 /* DMA-Controller bit position. */
3607
/* PR.PRPA bit masks and bit positions */
3608
#define PR_DAC_bm 0x04 /* Port A DAC bit mask. */
3609
#define PR_DAC_bp 2 /* Port A DAC bit position. */
3611
#define PR_ADC_bm 0x02 /* Port A ADC bit mask. */
3612
#define PR_ADC_bp 1 /* Port A ADC bit position. */
3614
#define PR_AC_bm 0x01 /* Port A Analog Comparator bit mask. */
3615
#define PR_AC_bp 0 /* Port A Analog Comparator bit position. */
3618
/* PR.PRPB bit masks and bit positions */
3619
/* PR_DAC_bm Predefined. */
3620
/* PR_DAC_bp Predefined. */
3622
/* PR_ADC_bm Predefined. */
3623
/* PR_ADC_bp Predefined. */
3625
/* PR_AC_bm Predefined. */
3626
/* PR_AC_bp Predefined. */
3629
/* PR.PRPC bit masks and bit positions */
3630
#define PR_TWI_bm 0x40 /* Port C Two-wire Interface bit mask. */
3631
#define PR_TWI_bp 6 /* Port C Two-wire Interface bit position. */
3633
#define PR_USART1_bm 0x20 /* Port C USART1 bit mask. */
3634
#define PR_USART1_bp 5 /* Port C USART1 bit position. */
3636
#define PR_USART0_bm 0x10 /* Port C USART0 bit mask. */
3637
#define PR_USART0_bp 4 /* Port C USART0 bit position. */
3639
#define PR_SPI_bm 0x08 /* Port C SPI bit mask. */
3640
#define PR_SPI_bp 3 /* Port C SPI bit position. */
3642
#define PR_HIRES_bm 0x04 /* Port C AWEX bit mask. */
3643
#define PR_HIRES_bp 2 /* Port C AWEX bit position. */
3645
#define PR_TC1_bm 0x02 /* Port C Timer/Counter1 bit mask. */
3646
#define PR_TC1_bp 1 /* Port C Timer/Counter1 bit position. */
3648
#define PR_TC0_bm 0x01 /* Port C Timer/Counter0 bit mask. */
3649
#define PR_TC0_bp 0 /* Port C Timer/Counter0 bit position. */
3652
/* PR.PRPD bit masks and bit positions */
3653
/* PR_TWI_bm Predefined. */
3654
/* PR_TWI_bp Predefined. */
3656
/* PR_USART1_bm Predefined. */
3657
/* PR_USART1_bp Predefined. */
3659
/* PR_USART0_bm Predefined. */
3660
/* PR_USART0_bp Predefined. */
3662
/* PR_SPI_bm Predefined. */
3663
/* PR_SPI_bp Predefined. */
3665
/* PR_HIRES_bm Predefined. */
3666
/* PR_HIRES_bp Predefined. */
3668
/* PR_TC1_bm Predefined. */
3669
/* PR_TC1_bp Predefined. */
3671
/* PR_TC0_bm Predefined. */
3672
/* PR_TC0_bp Predefined. */
3675
/* PR.PRPE bit masks and bit positions */
3676
/* PR_TWI_bm Predefined. */
3677
/* PR_TWI_bp Predefined. */
3679
/* PR_USART1_bm Predefined. */
3680
/* PR_USART1_bp Predefined. */
3682
/* PR_USART0_bm Predefined. */
3683
/* PR_USART0_bp Predefined. */
3685
/* PR_SPI_bm Predefined. */
3686
/* PR_SPI_bp Predefined. */
3688
/* PR_HIRES_bm Predefined. */
3689
/* PR_HIRES_bp Predefined. */
3691
/* PR_TC1_bm Predefined. */
3692
/* PR_TC1_bp Predefined. */
3694
/* PR_TC0_bm Predefined. */
3695
/* PR_TC0_bp Predefined. */
3698
/* PR.PRPF bit masks and bit positions */
3699
/* PR_TWI_bm Predefined. */
3700
/* PR_TWI_bp Predefined. */
3702
/* PR_USART1_bm Predefined. */
3703
/* PR_USART1_bp Predefined. */
3705
/* PR_USART0_bm Predefined. */
3706
/* PR_USART0_bp Predefined. */
3708
/* PR_SPI_bm Predefined. */
3709
/* PR_SPI_bp Predefined. */
3711
/* PR_HIRES_bm Predefined. */
3712
/* PR_HIRES_bp Predefined. */
3714
/* PR_TC1_bm Predefined. */
3715
/* PR_TC1_bp Predefined. */
3717
/* PR_TC0_bm Predefined. */
3718
/* PR_TC0_bp Predefined. */
3721
/* SLEEP - Sleep Controller */
3722
/* SLEEP.CTRL bit masks and bit positions */
3723
#define SLEEP_SMODE_gm 0x0E /* Sleep Mode group mask. */
3724
#define SLEEP_SMODE_gp 1 /* Sleep Mode group position. */
3725
#define SLEEP_SMODE0_bm (1<<1) /* Sleep Mode bit 0 mask. */
3726
#define SLEEP_SMODE0_bp 1 /* Sleep Mode bit 0 position. */
3727
#define SLEEP_SMODE1_bm (1<<2) /* Sleep Mode bit 1 mask. */
3728
#define SLEEP_SMODE1_bp 2 /* Sleep Mode bit 1 position. */
3729
#define SLEEP_SMODE2_bm (1<<3) /* Sleep Mode bit 2 mask. */
3730
#define SLEEP_SMODE2_bp 3 /* Sleep Mode bit 2 position. */
3732
#define SLEEP_SEN_bm 0x01 /* Sleep Enable bit mask. */
3733
#define SLEEP_SEN_bp 0 /* Sleep Enable bit position. */
3736
/* OSC - Oscillator */
3737
/* OSC.CTRL bit masks and bit positions */
3738
#define OSC_PLLEN_bm 0x10 /* PLL Enable bit mask. */
3739
#define OSC_PLLEN_bp 4 /* PLL Enable bit position. */
3741
#define OSC_XOSCEN_bm 0x08 /* External Oscillator Enable bit mask. */
3742
#define OSC_XOSCEN_bp 3 /* External Oscillator Enable bit position. */
3744
#define OSC_RC32KEN_bm 0x04 /* Internal 32kHz RC Oscillator Enable bit mask. */
3745
#define OSC_RC32KEN_bp 2 /* Internal 32kHz RC Oscillator Enable bit position. */
3747
#define OSC_RC32MEN_bm 0x02 /* Internal 32MHz RC Oscillator Enable bit mask. */
3748
#define OSC_RC32MEN_bp 1 /* Internal 32MHz RC Oscillator Enable bit position. */
3750
#define OSC_RC2MEN_bm 0x01 /* Internal 2MHz RC Oscillator Enable bit mask. */
3751
#define OSC_RC2MEN_bp 0 /* Internal 2MHz RC Oscillator Enable bit position. */
3754
/* OSC.STATUS bit masks and bit positions */
3755
#define OSC_PLLRDY_bm 0x10 /* PLL Ready bit mask. */
3756
#define OSC_PLLRDY_bp 4 /* PLL Ready bit position. */
3758
#define OSC_XOSCRDY_bm 0x08 /* External Oscillator Ready bit mask. */
3759
#define OSC_XOSCRDY_bp 3 /* External Oscillator Ready bit position. */
3761
#define OSC_RC32KRDY_bm 0x04 /* Internal 32kHz RC Oscillator Ready bit mask. */
3762
#define OSC_RC32KRDY_bp 2 /* Internal 32kHz RC Oscillator Ready bit position. */
3764
#define OSC_RC32MRDY_bm 0x02 /* Internal 32MHz RC Oscillator Ready bit mask. */
3765
#define OSC_RC32MRDY_bp 1 /* Internal 32MHz RC Oscillator Ready bit position. */
3767
#define OSC_RC2MRDY_bm 0x01 /* Internal 2MHz RC Oscillator Ready bit mask. */
3768
#define OSC_RC2MRDY_bp 0 /* Internal 2MHz RC Oscillator Ready bit position. */
3771
/* OSC.XOSCCTRL bit masks and bit positions */
3772
#define OSC_FRQRANGE_gm 0xC0 /* Frequency Range group mask. */
3773
#define OSC_FRQRANGE_gp 6 /* Frequency Range group position. */
3774
#define OSC_FRQRANGE0_bm (1<<6) /* Frequency Range bit 0 mask. */
3775
#define OSC_FRQRANGE0_bp 6 /* Frequency Range bit 0 position. */
3776
#define OSC_FRQRANGE1_bm (1<<7) /* Frequency Range bit 1 mask. */
3777
#define OSC_FRQRANGE1_bp 7 /* Frequency Range bit 1 position. */
3779
#define OSC_X32KLPM_bm 0x20 /* 32kHz XTAL OSC Low-power Mode bit mask. */
3780
#define OSC_X32KLPM_bp 5 /* 32kHz XTAL OSC Low-power Mode bit position. */
3782
#define OSC_XOSCSEL_gm 0x0F /* External Oscillator Selection and Startup Time group mask. */
3783
#define OSC_XOSCSEL_gp 0 /* External Oscillator Selection and Startup Time group position. */
3784
#define OSC_XOSCSEL0_bm (1<<0) /* External Oscillator Selection and Startup Time bit 0 mask. */
3785
#define OSC_XOSCSEL0_bp 0 /* External Oscillator Selection and Startup Time bit 0 position. */
3786
#define OSC_XOSCSEL1_bm (1<<1) /* External Oscillator Selection and Startup Time bit 1 mask. */
3787
#define OSC_XOSCSEL1_bp 1 /* External Oscillator Selection and Startup Time bit 1 position. */
3788
#define OSC_XOSCSEL2_bm (1<<2) /* External Oscillator Selection and Startup Time bit 2 mask. */
3789
#define OSC_XOSCSEL2_bp 2 /* External Oscillator Selection and Startup Time bit 2 position. */
3790
#define OSC_XOSCSEL3_bm (1<<3) /* External Oscillator Selection and Startup Time bit 3 mask. */
3791
#define OSC_XOSCSEL3_bp 3 /* External Oscillator Selection and Startup Time bit 3 position. */
3794
/* OSC.XOSCFAIL bit masks and bit positions */
3795
#define OSC_XOSCFDIF_bm 0x02 /* Failure Detection Interrupt Flag bit mask. */
3796
#define OSC_XOSCFDIF_bp 1 /* Failure Detection Interrupt Flag bit position. */
3798
#define OSC_XOSCFDEN_bm 0x01 /* Failure Detection Enable bit mask. */
3799
#define OSC_XOSCFDEN_bp 0 /* Failure Detection Enable bit position. */
3802
/* OSC.PLLCTRL bit masks and bit positions */
3803
#define OSC_PLLSRC_gm 0xC0 /* Clock Source group mask. */
3804
#define OSC_PLLSRC_gp 6 /* Clock Source group position. */
3805
#define OSC_PLLSRC0_bm (1<<6) /* Clock Source bit 0 mask. */
3806
#define OSC_PLLSRC0_bp 6 /* Clock Source bit 0 position. */
3807
#define OSC_PLLSRC1_bm (1<<7) /* Clock Source bit 1 mask. */
3808
#define OSC_PLLSRC1_bp 7 /* Clock Source bit 1 position. */
3810
#define OSC_PLLFAC_gm 0x1F /* Multiplication Factor group mask. */
3811
#define OSC_PLLFAC_gp 0 /* Multiplication Factor group position. */
3812
#define OSC_PLLFAC0_bm (1<<0) /* Multiplication Factor bit 0 mask. */
3813
#define OSC_PLLFAC0_bp 0 /* Multiplication Factor bit 0 position. */
3814
#define OSC_PLLFAC1_bm (1<<1) /* Multiplication Factor bit 1 mask. */
3815
#define OSC_PLLFAC1_bp 1 /* Multiplication Factor bit 1 position. */
3816
#define OSC_PLLFAC2_bm (1<<2) /* Multiplication Factor bit 2 mask. */
3817
#define OSC_PLLFAC2_bp 2 /* Multiplication Factor bit 2 position. */
3818
#define OSC_PLLFAC3_bm (1<<3) /* Multiplication Factor bit 3 mask. */
3819
#define OSC_PLLFAC3_bp 3 /* Multiplication Factor bit 3 position. */
3820
#define OSC_PLLFAC4_bm (1<<4) /* Multiplication Factor bit 4 mask. */
3821
#define OSC_PLLFAC4_bp 4 /* Multiplication Factor bit 4 position. */
3824
/* OSC.DFLLCTRL bit masks and bit positions */
3825
#define OSC_RC32MCREF_bm 0x02 /* 32MHz Calibration Reference bit mask. */
3826
#define OSC_RC32MCREF_bp 1 /* 32MHz Calibration Reference bit position. */
3828
#define OSC_RC2MCREF_bm 0x01 /* 2MHz Calibration Reference bit mask. */
3829
#define OSC_RC2MCREF_bp 0 /* 2MHz Calibration Reference bit position. */
3833
/* DFLL.CTRL bit masks and bit positions */
3834
#define DFLL_ENABLE_bm 0x01 /* DFLL Enable bit mask. */
3835
#define DFLL_ENABLE_bp 0 /* DFLL Enable bit position. */
3838
/* DFLL.CALA bit masks and bit positions */
3839
#define DFLL_CALL_gm 0x7F /* DFLL Calibration bits [6:0] group mask. */
3840
#define DFLL_CALL_gp 0 /* DFLL Calibration bits [6:0] group position. */
3841
#define DFLL_CALL0_bm (1<<0) /* DFLL Calibration bits [6:0] bit 0 mask. */
3842
#define DFLL_CALL0_bp 0 /* DFLL Calibration bits [6:0] bit 0 position. */
3843
#define DFLL_CALL1_bm (1<<1) /* DFLL Calibration bits [6:0] bit 1 mask. */
3844
#define DFLL_CALL1_bp 1 /* DFLL Calibration bits [6:0] bit 1 position. */
3845
#define DFLL_CALL2_bm (1<<2) /* DFLL Calibration bits [6:0] bit 2 mask. */
3846
#define DFLL_CALL2_bp 2 /* DFLL Calibration bits [6:0] bit 2 position. */
3847
#define DFLL_CALL3_bm (1<<3) /* DFLL Calibration bits [6:0] bit 3 mask. */
3848
#define DFLL_CALL3_bp 3 /* DFLL Calibration bits [6:0] bit 3 position. */
3849
#define DFLL_CALL4_bm (1<<4) /* DFLL Calibration bits [6:0] bit 4 mask. */
3850
#define DFLL_CALL4_bp 4 /* DFLL Calibration bits [6:0] bit 4 position. */
3851
#define DFLL_CALL5_bm (1<<5) /* DFLL Calibration bits [6:0] bit 5 mask. */
3852
#define DFLL_CALL5_bp 5 /* DFLL Calibration bits [6:0] bit 5 position. */
3853
#define DFLL_CALL6_bm (1<<6) /* DFLL Calibration bits [6:0] bit 6 mask. */
3854
#define DFLL_CALL6_bp 6 /* DFLL Calibration bits [6:0] bit 6 position. */
3857
/* DFLL.CALB bit masks and bit positions */
3858
#define DFLL_CALH_gm 0x3F /* DFLL Calibration bits [12:7] group mask. */
3859
#define DFLL_CALH_gp 0 /* DFLL Calibration bits [12:7] group position. */
3860
#define DFLL_CALH0_bm (1<<0) /* DFLL Calibration bits [12:7] bit 0 mask. */
3861
#define DFLL_CALH0_bp 0 /* DFLL Calibration bits [12:7] bit 0 position. */
3862
#define DFLL_CALH1_bm (1<<1) /* DFLL Calibration bits [12:7] bit 1 mask. */
3863
#define DFLL_CALH1_bp 1 /* DFLL Calibration bits [12:7] bit 1 position. */
3864
#define DFLL_CALH2_bm (1<<2) /* DFLL Calibration bits [12:7] bit 2 mask. */
3865
#define DFLL_CALH2_bp 2 /* DFLL Calibration bits [12:7] bit 2 position. */
3866
#define DFLL_CALH3_bm (1<<3) /* DFLL Calibration bits [12:7] bit 3 mask. */
3867
#define DFLL_CALH3_bp 3 /* DFLL Calibration bits [12:7] bit 3 position. */
3868
#define DFLL_CALH4_bm (1<<4) /* DFLL Calibration bits [12:7] bit 4 mask. */
3869
#define DFLL_CALH4_bp 4 /* DFLL Calibration bits [12:7] bit 4 position. */
3870
#define DFLL_CALH5_bm (1<<5) /* DFLL Calibration bits [12:7] bit 5 mask. */
3871
#define DFLL_CALH5_bp 5 /* DFLL Calibration bits [12:7] bit 5 position. */
3875
/* RST.STATUS bit masks and bit positions */
3876
#define RST_SDRF_bm 0x40 /* Spike Detection Reset Flag bit mask. */
3877
#define RST_SDRF_bp 6 /* Spike Detection Reset Flag bit position. */
3879
#define RST_SRF_bm 0x20 /* Software Reset Flag bit mask. */
3880
#define RST_SRF_bp 5 /* Software Reset Flag bit position. */
3882
#define RST_PDIRF_bm 0x10 /* Programming and Debug Interface Interface Reset Flag bit mask. */
3883
#define RST_PDIRF_bp 4 /* Programming and Debug Interface Interface Reset Flag bit position. */
3885
#define RST_WDRF_bm 0x08 /* Watchdog Reset Flag bit mask. */
3886
#define RST_WDRF_bp 3 /* Watchdog Reset Flag bit position. */
3888
#define RST_BORF_bm 0x04 /* Brown-out Reset Flag bit mask. */
3889
#define RST_BORF_bp 2 /* Brown-out Reset Flag bit position. */
3891
#define RST_EXTRF_bm 0x02 /* External Reset Flag bit mask. */
3892
#define RST_EXTRF_bp 1 /* External Reset Flag bit position. */
3894
#define RST_PORF_bm 0x01 /* Power-on Reset Flag bit mask. */
3895
#define RST_PORF_bp 0 /* Power-on Reset Flag bit position. */
3898
/* RST.CTRL bit masks and bit positions */
3899
#define RST_SWRST_bm 0x01 /* Software Reset bit mask. */
3900
#define RST_SWRST_bp 0 /* Software Reset bit position. */
3903
/* WDT - Watch-Dog Timer */
3904
/* WDT.CTRL bit masks and bit positions */
3905
#define WDT_PER_gm 0x3C /* Period group mask. */
3906
#define WDT_PER_gp 2 /* Period group position. */
3907
#define WDT_PER0_bm (1<<2) /* Period bit 0 mask. */
3908
#define WDT_PER0_bp 2 /* Period bit 0 position. */
3909
#define WDT_PER1_bm (1<<3) /* Period bit 1 mask. */
3910
#define WDT_PER1_bp 3 /* Period bit 1 position. */
3911
#define WDT_PER2_bm (1<<4) /* Period bit 2 mask. */
3912
#define WDT_PER2_bp 4 /* Period bit 2 position. */
3913
#define WDT_PER3_bm (1<<5) /* Period bit 3 mask. */
3914
#define WDT_PER3_bp 5 /* Period bit 3 position. */
3916
#define WDT_ENABLE_bm 0x02 /* Enable bit mask. */
3917
#define WDT_ENABLE_bp 1 /* Enable bit position. */
3919
#define WDT_CEN_bm 0x01 /* Change Enable bit mask. */
3920
#define WDT_CEN_bp 0 /* Change Enable bit position. */
3923
/* WDT.WINCTRL bit masks and bit positions */
3924
#define WDT_WPER_gm 0x3C /* Windowed Mode Period group mask. */
3925
#define WDT_WPER_gp 2 /* Windowed Mode Period group position. */
3926
#define WDT_WPER0_bm (1<<2) /* Windowed Mode Period bit 0 mask. */
3927
#define WDT_WPER0_bp 2 /* Windowed Mode Period bit 0 position. */
3928
#define WDT_WPER1_bm (1<<3) /* Windowed Mode Period bit 1 mask. */
3929
#define WDT_WPER1_bp 3 /* Windowed Mode Period bit 1 position. */
3930
#define WDT_WPER2_bm (1<<4) /* Windowed Mode Period bit 2 mask. */
3931
#define WDT_WPER2_bp 4 /* Windowed Mode Period bit 2 position. */
3932
#define WDT_WPER3_bm (1<<5) /* Windowed Mode Period bit 3 mask. */
3933
#define WDT_WPER3_bp 5 /* Windowed Mode Period bit 3 position. */
3935
#define WDT_WEN_bm 0x02 /* Windowed Mode Enable bit mask. */
3936
#define WDT_WEN_bp 1 /* Windowed Mode Enable bit position. */
3938
#define WDT_WCEN_bm 0x01 /* Windowed Mode Change Enable bit mask. */
3939
#define WDT_WCEN_bp 0 /* Windowed Mode Change Enable bit position. */
3942
/* WDT.STATUS bit masks and bit positions */
3943
#define WDT_SYNCBUSY_bm 0x01 /* Syncronization busy bit mask. */
3944
#define WDT_SYNCBUSY_bp 0 /* Syncronization busy bit position. */
3947
/* MCU - MCU Control */
3948
/* MCU.MCUCR bit masks and bit positions */
3949
#define MCU_JTAGD_bm 0x01 /* JTAG Disable bit mask. */
3950
#define MCU_JTAGD_bp 0 /* JTAG Disable bit position. */
3953
/* MCU.EVSYSLOCK bit masks and bit positions */
3954
#define MCU_EVSYS1LOCK_bm 0x10 /* Event Channel 4-7 Lock bit mask. */
3955
#define MCU_EVSYS1LOCK_bp 4 /* Event Channel 4-7 Lock bit position. */
3957
#define MCU_EVSYS0LOCK_bm 0x01 /* Event Channel 0-3 Lock bit mask. */
3958
#define MCU_EVSYS0LOCK_bp 0 /* Event Channel 0-3 Lock bit position. */
3961
/* MCU.AWEXLOCK bit masks and bit positions */
3962
#define MCU_AWEXELOCK_bm 0x04 /* AWeX on T/C E0 Lock bit mask. */
3963
#define MCU_AWEXELOCK_bp 2 /* AWeX on T/C E0 Lock bit position. */
3965
#define MCU_AWEXCLOCK_bm 0x01 /* AWeX on T/C C0 Lock bit mask. */
3966
#define MCU_AWEXCLOCK_bp 0 /* AWeX on T/C C0 Lock bit position. */
3969
/* PMIC - Programmable Multi-level Interrupt Controller */
3970
/* PMIC.STATUS bit masks and bit positions */
3971
#define PMIC_NMIEX_bm 0x80 /* Non-maskable Interrupt Executing bit mask. */
3972
#define PMIC_NMIEX_bp 7 /* Non-maskable Interrupt Executing bit position. */
3974
#define PMIC_HILVLEX_bm 0x04 /* High Level Interrupt Executing bit mask. */
3975
#define PMIC_HILVLEX_bp 2 /* High Level Interrupt Executing bit position. */
3977
#define PMIC_MEDLVLEX_bm 0x02 /* Medium Level Interrupt Executing bit mask. */
3978
#define PMIC_MEDLVLEX_bp 1 /* Medium Level Interrupt Executing bit position. */
3980
#define PMIC_LOLVLEX_bm 0x01 /* Low Level Interrupt Executing bit mask. */
3981
#define PMIC_LOLVLEX_bp 0 /* Low Level Interrupt Executing bit position. */
3984
/* PMIC.CTRL bit masks and bit positions */
3985
#define PMIC_RREN_bm 0x80 /* Round-Robin Priority Enable bit mask. */
3986
#define PMIC_RREN_bp 7 /* Round-Robin Priority Enable bit position. */
3988
#define PMIC_IVSEL_bm 0x40 /* Interrupt Vector Select bit mask. */
3989
#define PMIC_IVSEL_bp 6 /* Interrupt Vector Select bit position. */
3991
#define PMIC_HILVLEN_bm 0x04 /* High Level Enable bit mask. */
3992
#define PMIC_HILVLEN_bp 2 /* High Level Enable bit position. */
3994
#define PMIC_MEDLVLEN_bm 0x02 /* Medium Level Enable bit mask. */
3995
#define PMIC_MEDLVLEN_bp 1 /* Medium Level Enable bit position. */
3997
#define PMIC_LOLVLEN_bm 0x01 /* Low Level Enable bit mask. */
3998
#define PMIC_LOLVLEN_bp 0 /* Low Level Enable bit position. */
4001
/* DMA - DMA Controller */
4002
/* DMA_CH.CTRLA bit masks and bit positions */
4003
#define DMA_CH_ENABLE_bm 0x80 /* Channel Enable bit mask. */
4004
#define DMA_CH_ENABLE_bp 7 /* Channel Enable bit position. */
4006
#define DMA_CH_RESET_bm 0x40 /* Channel Software Reset bit mask. */
4007
#define DMA_CH_RESET_bp 6 /* Channel Software Reset bit position. */
4009
#define DMA_CH_REPEAT_bm 0x20 /* Channel Repeat Mode bit mask. */
4010
#define DMA_CH_REPEAT_bp 5 /* Channel Repeat Mode bit position. */
4012
#define DMA_CH_TRFREQ_bm 0x10 /* Channel Transfer Request bit mask. */
4013
#define DMA_CH_TRFREQ_bp 4 /* Channel Transfer Request bit position. */
4015
#define DMA_CH_SINGLE_bm 0x04 /* Channel Single Shot Data Transfer bit mask. */
4016
#define DMA_CH_SINGLE_bp 2 /* Channel Single Shot Data Transfer bit position. */
4018
#define DMA_CH_BURSTLEN_gm 0x03 /* Channel Transfer Mode group mask. */
4019
#define DMA_CH_BURSTLEN_gp 0 /* Channel Transfer Mode group position. */
4020
#define DMA_CH_BURSTLEN0_bm (1<<0) /* Channel Transfer Mode bit 0 mask. */
4021
#define DMA_CH_BURSTLEN0_bp 0 /* Channel Transfer Mode bit 0 position. */
4022
#define DMA_CH_BURSTLEN1_bm (1<<1) /* Channel Transfer Mode bit 1 mask. */
4023
#define DMA_CH_BURSTLEN1_bp 1 /* Channel Transfer Mode bit 1 position. */
4026
/* DMA_CH.CTRLB bit masks and bit positions */
4027
#define DMA_CH_CHBUSY_bm 0x80 /* Block Transfer Busy bit mask. */
4028
#define DMA_CH_CHBUSY_bp 7 /* Block Transfer Busy bit position. */
4030
#define DMA_CH_CHPEND_bm 0x40 /* Block Transfer Pending bit mask. */
4031
#define DMA_CH_CHPEND_bp 6 /* Block Transfer Pending bit position. */
4033
#define DMA_CH_ERRIF_bm 0x20 /* Block Transfer Error Interrupt Flag bit mask. */
4034
#define DMA_CH_ERRIF_bp 5 /* Block Transfer Error Interrupt Flag bit position. */
4036
#define DMA_CH_TRNIF_bm 0x10 /* Transaction Complete Interrup Flag bit mask. */
4037
#define DMA_CH_TRNIF_bp 4 /* Transaction Complete Interrup Flag bit position. */
4039
#define DMA_CH_ERRINTLVL_gm 0x0C /* Transfer Error Interrupt Level group mask. */
4040
#define DMA_CH_ERRINTLVL_gp 2 /* Transfer Error Interrupt Level group position. */
4041
#define DMA_CH_ERRINTLVL0_bm (1<<2) /* Transfer Error Interrupt Level bit 0 mask. */
4042
#define DMA_CH_ERRINTLVL0_bp 2 /* Transfer Error Interrupt Level bit 0 position. */
4043
#define DMA_CH_ERRINTLVL1_bm (1<<3) /* Transfer Error Interrupt Level bit 1 mask. */
4044
#define DMA_CH_ERRINTLVL1_bp 3 /* Transfer Error Interrupt Level bit 1 position. */
4046
#define DMA_CH_TRNINTLVL_gm 0x03 /* Transaction Complete Interrupt Level group mask. */
4047
#define DMA_CH_TRNINTLVL_gp 0 /* Transaction Complete Interrupt Level group position. */
4048
#define DMA_CH_TRNINTLVL0_bm (1<<0) /* Transaction Complete Interrupt Level bit 0 mask. */
4049
#define DMA_CH_TRNINTLVL0_bp 0 /* Transaction Complete Interrupt Level bit 0 position. */
4050
#define DMA_CH_TRNINTLVL1_bm (1<<1) /* Transaction Complete Interrupt Level bit 1 mask. */
4051
#define DMA_CH_TRNINTLVL1_bp 1 /* Transaction Complete Interrupt Level bit 1 position. */
4054
/* DMA_CH.ADDRCTRL bit masks and bit positions */
4055
#define DMA_CH_SRCRELOAD_gm 0xC0 /* Channel Source Address Reload group mask. */
4056
#define DMA_CH_SRCRELOAD_gp 6 /* Channel Source Address Reload group position. */
4057
#define DMA_CH_SRCRELOAD0_bm (1<<6) /* Channel Source Address Reload bit 0 mask. */
4058
#define DMA_CH_SRCRELOAD0_bp 6 /* Channel Source Address Reload bit 0 position. */
4059
#define DMA_CH_SRCRELOAD1_bm (1<<7) /* Channel Source Address Reload bit 1 mask. */
4060
#define DMA_CH_SRCRELOAD1_bp 7 /* Channel Source Address Reload bit 1 position. */
4062
#define DMA_CH_SRCDIR_gm 0x30 /* Channel Source Address Mode group mask. */
4063
#define DMA_CH_SRCDIR_gp 4 /* Channel Source Address Mode group position. */
4064
#define DMA_CH_SRCDIR0_bm (1<<4) /* Channel Source Address Mode bit 0 mask. */
4065
#define DMA_CH_SRCDIR0_bp 4 /* Channel Source Address Mode bit 0 position. */
4066
#define DMA_CH_SRCDIR1_bm (1<<5) /* Channel Source Address Mode bit 1 mask. */
4067
#define DMA_CH_SRCDIR1_bp 5 /* Channel Source Address Mode bit 1 position. */
4069
#define DMA_CH_DESTRELOAD_gm 0x0C /* Channel Destination Address Reload group mask. */
4070
#define DMA_CH_DESTRELOAD_gp 2 /* Channel Destination Address Reload group position. */
4071
#define DMA_CH_DESTRELOAD0_bm (1<<2) /* Channel Destination Address Reload bit 0 mask. */
4072
#define DMA_CH_DESTRELOAD0_bp 2 /* Channel Destination Address Reload bit 0 position. */
4073
#define DMA_CH_DESTRELOAD1_bm (1<<3) /* Channel Destination Address Reload bit 1 mask. */
4074
#define DMA_CH_DESTRELOAD1_bp 3 /* Channel Destination Address Reload bit 1 position. */
4076
#define DMA_CH_DESTDIR_gm 0x03 /* Channel Destination Address Mode group mask. */
4077
#define DMA_CH_DESTDIR_gp 0 /* Channel Destination Address Mode group position. */
4078
#define DMA_CH_DESTDIR0_bm (1<<0) /* Channel Destination Address Mode bit 0 mask. */
4079
#define DMA_CH_DESTDIR0_bp 0 /* Channel Destination Address Mode bit 0 position. */
4080
#define DMA_CH_DESTDIR1_bm (1<<1) /* Channel Destination Address Mode bit 1 mask. */
4081
#define DMA_CH_DESTDIR1_bp 1 /* Channel Destination Address Mode bit 1 position. */
4084
/* DMA_CH.TRIGSRC bit masks and bit positions */
4085
#define DMA_CH_TRIGSRC_gm 0xFF /* Channel Trigger Source group mask. */
4086
#define DMA_CH_TRIGSRC_gp 0 /* Channel Trigger Source group position. */
4087
#define DMA_CH_TRIGSRC0_bm (1<<0) /* Channel Trigger Source bit 0 mask. */
4088
#define DMA_CH_TRIGSRC0_bp 0 /* Channel Trigger Source bit 0 position. */
4089
#define DMA_CH_TRIGSRC1_bm (1<<1) /* Channel Trigger Source bit 1 mask. */
4090
#define DMA_CH_TRIGSRC1_bp 1 /* Channel Trigger Source bit 1 position. */
4091
#define DMA_CH_TRIGSRC2_bm (1<<2) /* Channel Trigger Source bit 2 mask. */
4092
#define DMA_CH_TRIGSRC2_bp 2 /* Channel Trigger Source bit 2 position. */
4093
#define DMA_CH_TRIGSRC3_bm (1<<3) /* Channel Trigger Source bit 3 mask. */
4094
#define DMA_CH_TRIGSRC3_bp 3 /* Channel Trigger Source bit 3 position. */
4095
#define DMA_CH_TRIGSRC4_bm (1<<4) /* Channel Trigger Source bit 4 mask. */
4096
#define DMA_CH_TRIGSRC4_bp 4 /* Channel Trigger Source bit 4 position. */
4097
#define DMA_CH_TRIGSRC5_bm (1<<5) /* Channel Trigger Source bit 5 mask. */
4098
#define DMA_CH_TRIGSRC5_bp 5 /* Channel Trigger Source bit 5 position. */
4099
#define DMA_CH_TRIGSRC6_bm (1<<6) /* Channel Trigger Source bit 6 mask. */
4100
#define DMA_CH_TRIGSRC6_bp 6 /* Channel Trigger Source bit 6 position. */
4101
#define DMA_CH_TRIGSRC7_bm (1<<7) /* Channel Trigger Source bit 7 mask. */
4102
#define DMA_CH_TRIGSRC7_bp 7 /* Channel Trigger Source bit 7 position. */
4105
/* DMA.CTRL bit masks and bit positions */
4106
#define DMA_ENABLE_bm 0x80 /* Enable bit mask. */
4107
#define DMA_ENABLE_bp 7 /* Enable bit position. */
4109
#define DMA_RESET_bm 0x40 /* Software Reset bit mask. */
4110
#define DMA_RESET_bp 6 /* Software Reset bit position. */
4112
#define DMA_DBUFMODE_gm 0x0C /* Double Buffering Mode group mask. */
4113
#define DMA_DBUFMODE_gp 2 /* Double Buffering Mode group position. */
4114
#define DMA_DBUFMODE0_bm (1<<2) /* Double Buffering Mode bit 0 mask. */
4115
#define DMA_DBUFMODE0_bp 2 /* Double Buffering Mode bit 0 position. */
4116
#define DMA_DBUFMODE1_bm (1<<3) /* Double Buffering Mode bit 1 mask. */
4117
#define DMA_DBUFMODE1_bp 3 /* Double Buffering Mode bit 1 position. */
4119
#define DMA_PRIMODE_gm 0x03 /* Channel Priority Mode group mask. */
4120
#define DMA_PRIMODE_gp 0 /* Channel Priority Mode group position. */
4121
#define DMA_PRIMODE0_bm (1<<0) /* Channel Priority Mode bit 0 mask. */
4122
#define DMA_PRIMODE0_bp 0 /* Channel Priority Mode bit 0 position. */
4123
#define DMA_PRIMODE1_bm (1<<1) /* Channel Priority Mode bit 1 mask. */
4124
#define DMA_PRIMODE1_bp 1 /* Channel Priority Mode bit 1 position. */
4127
/* DMA.INTFLAGS bit masks and bit positions */
4128
#define DMA_CH3ERRIF_bm 0x80 /* Channel 3 Block Transfer Error Interrupt Flag bit mask. */
4129
#define DMA_CH3ERRIF_bp 7 /* Channel 3 Block Transfer Error Interrupt Flag bit position. */
4131
#define DMA_CH2ERRIF_bm 0x40 /* Channel 2 Block Transfer Error Interrupt Flag bit mask. */
4132
#define DMA_CH2ERRIF_bp 6 /* Channel 2 Block Transfer Error Interrupt Flag bit position. */
4134
#define DMA_CH1ERRIF_bm 0x20 /* Channel 1 Block Transfer Error Interrupt Flag bit mask. */
4135
#define DMA_CH1ERRIF_bp 5 /* Channel 1 Block Transfer Error Interrupt Flag bit position. */
4137
#define DMA_CH0ERRIF_bm 0x10 /* Channel 0 Block Transfer Error Interrupt Flag bit mask. */
4138
#define DMA_CH0ERRIF_bp 4 /* Channel 0 Block Transfer Error Interrupt Flag bit position. */
4140
#define DMA_CH3TRNIF_bm 0x08 /* Channel 3 Transaction Complete Interrupt Flag bit mask. */
4141
#define DMA_CH3TRNIF_bp 3 /* Channel 3 Transaction Complete Interrupt Flag bit position. */
4143
#define DMA_CH2TRNIF_bm 0x04 /* Channel 2 Transaction Complete Interrupt Flag bit mask. */
4144
#define DMA_CH2TRNIF_bp 2 /* Channel 2 Transaction Complete Interrupt Flag bit position. */
4146
#define DMA_CH1TRNIF_bm 0x02 /* Channel 1 Transaction Complete Interrupt Flag bit mask. */
4147
#define DMA_CH1TRNIF_bp 1 /* Channel 1 Transaction Complete Interrupt Flag bit position. */
4149
#define DMA_CH0TRNIF_bm 0x01 /* Channel 0 Transaction Complete Interrupt Flag bit mask. */
4150
#define DMA_CH0TRNIF_bp 0 /* Channel 0 Transaction Complete Interrupt Flag bit position. */
4153
/* DMA.STATUS bit masks and bit positions */
4154
#define DMA_CH3BUSY_bm 0x80 /* Channel 3 Block Transfer Busy bit mask. */
4155
#define DMA_CH3BUSY_bp 7 /* Channel 3 Block Transfer Busy bit position. */
4157
#define DMA_CH2BUSY_bm 0x40 /* Channel 2 Block Transfer Busy bit mask. */
4158
#define DMA_CH2BUSY_bp 6 /* Channel 2 Block Transfer Busy bit position. */
4160
#define DMA_CH1BUSY_bm 0x20 /* Channel 1 Block Transfer Busy bit mask. */
4161
#define DMA_CH1BUSY_bp 5 /* Channel 1 Block Transfer Busy bit position. */
4163
#define DMA_CH0BUSY_bm 0x10 /* Channel 0 Block Transfer Busy bit mask. */
4164
#define DMA_CH0BUSY_bp 4 /* Channel 0 Block Transfer Busy bit position. */
4166
#define DMA_CH3PEND_bm 0x08 /* Channel 3 Block Transfer Pending bit mask. */
4167
#define DMA_CH3PEND_bp 3 /* Channel 3 Block Transfer Pending bit position. */
4169
#define DMA_CH2PEND_bm 0x04 /* Channel 2 Block Transfer Pending bit mask. */
4170
#define DMA_CH2PEND_bp 2 /* Channel 2 Block Transfer Pending bit position. */
4172
#define DMA_CH1PEND_bm 0x02 /* Channel 1 Block Transfer Pending bit mask. */
4173
#define DMA_CH1PEND_bp 1 /* Channel 1 Block Transfer Pending bit position. */
4175
#define DMA_CH0PEND_bm 0x01 /* Channel 0 Block Transfer Pending bit mask. */
4176
#define DMA_CH0PEND_bp 0 /* Channel 0 Block Transfer Pending bit position. */
4179
/* EVSYS - Event System */
4180
/* EVSYS.CH0MUX bit masks and bit positions */
4181
#define EVSYS_CHMUX_gm 0xFF /* Event Channel 0 Multiplexer group mask. */
4182
#define EVSYS_CHMUX_gp 0 /* Event Channel 0 Multiplexer group position. */
4183
#define EVSYS_CHMUX0_bm (1<<0) /* Event Channel 0 Multiplexer bit 0 mask. */
4184
#define EVSYS_CHMUX0_bp 0 /* Event Channel 0 Multiplexer bit 0 position. */
4185
#define EVSYS_CHMUX1_bm (1<<1) /* Event Channel 0 Multiplexer bit 1 mask. */
4186
#define EVSYS_CHMUX1_bp 1 /* Event Channel 0 Multiplexer bit 1 position. */
4187
#define EVSYS_CHMUX2_bm (1<<2) /* Event Channel 0 Multiplexer bit 2 mask. */
4188
#define EVSYS_CHMUX2_bp 2 /* Event Channel 0 Multiplexer bit 2 position. */
4189
#define EVSYS_CHMUX3_bm (1<<3) /* Event Channel 0 Multiplexer bit 3 mask. */
4190
#define EVSYS_CHMUX3_bp 3 /* Event Channel 0 Multiplexer bit 3 position. */
4191
#define EVSYS_CHMUX4_bm (1<<4) /* Event Channel 0 Multiplexer bit 4 mask. */
4192
#define EVSYS_CHMUX4_bp 4 /* Event Channel 0 Multiplexer bit 4 position. */
4193
#define EVSYS_CHMUX5_bm (1<<5) /* Event Channel 0 Multiplexer bit 5 mask. */
4194
#define EVSYS_CHMUX5_bp 5 /* Event Channel 0 Multiplexer bit 5 position. */
4195
#define EVSYS_CHMUX6_bm (1<<6) /* Event Channel 0 Multiplexer bit 6 mask. */
4196
#define EVSYS_CHMUX6_bp 6 /* Event Channel 0 Multiplexer bit 6 position. */
4197
#define EVSYS_CHMUX7_bm (1<<7) /* Event Channel 0 Multiplexer bit 7 mask. */
4198
#define EVSYS_CHMUX7_bp 7 /* Event Channel 0 Multiplexer bit 7 position. */
4201
/* EVSYS.CH1MUX bit masks and bit positions */
4202
/* EVSYS_CHMUX_gm Predefined. */
4203
/* EVSYS_CHMUX_gp Predefined. */
4204
/* EVSYS_CHMUX0_bm Predefined. */
4205
/* EVSYS_CHMUX0_bp Predefined. */
4206
/* EVSYS_CHMUX1_bm Predefined. */
4207
/* EVSYS_CHMUX1_bp Predefined. */
4208
/* EVSYS_CHMUX2_bm Predefined. */
4209
/* EVSYS_CHMUX2_bp Predefined. */
4210
/* EVSYS_CHMUX3_bm Predefined. */
4211
/* EVSYS_CHMUX3_bp Predefined. */
4212
/* EVSYS_CHMUX4_bm Predefined. */
4213
/* EVSYS_CHMUX4_bp Predefined. */
4214
/* EVSYS_CHMUX5_bm Predefined. */
4215
/* EVSYS_CHMUX5_bp Predefined. */
4216
/* EVSYS_CHMUX6_bm Predefined. */
4217
/* EVSYS_CHMUX6_bp Predefined. */
4218
/* EVSYS_CHMUX7_bm Predefined. */
4219
/* EVSYS_CHMUX7_bp Predefined. */
4222
/* EVSYS.CH2MUX bit masks and bit positions */
4223
/* EVSYS_CHMUX_gm Predefined. */
4224
/* EVSYS_CHMUX_gp Predefined. */
4225
/* EVSYS_CHMUX0_bm Predefined. */
4226
/* EVSYS_CHMUX0_bp Predefined. */
4227
/* EVSYS_CHMUX1_bm Predefined. */
4228
/* EVSYS_CHMUX1_bp Predefined. */
4229
/* EVSYS_CHMUX2_bm Predefined. */
4230
/* EVSYS_CHMUX2_bp Predefined. */
4231
/* EVSYS_CHMUX3_bm Predefined. */
4232
/* EVSYS_CHMUX3_bp Predefined. */
4233
/* EVSYS_CHMUX4_bm Predefined. */
4234
/* EVSYS_CHMUX4_bp Predefined. */
4235
/* EVSYS_CHMUX5_bm Predefined. */
4236
/* EVSYS_CHMUX5_bp Predefined. */
4237
/* EVSYS_CHMUX6_bm Predefined. */
4238
/* EVSYS_CHMUX6_bp Predefined. */
4239
/* EVSYS_CHMUX7_bm Predefined. */
4240
/* EVSYS_CHMUX7_bp Predefined. */
4243
/* EVSYS.CH3MUX bit masks and bit positions */
4244
/* EVSYS_CHMUX_gm Predefined. */
4245
/* EVSYS_CHMUX_gp Predefined. */
4246
/* EVSYS_CHMUX0_bm Predefined. */
4247
/* EVSYS_CHMUX0_bp Predefined. */
4248
/* EVSYS_CHMUX1_bm Predefined. */
4249
/* EVSYS_CHMUX1_bp Predefined. */
4250
/* EVSYS_CHMUX2_bm Predefined. */
4251
/* EVSYS_CHMUX2_bp Predefined. */
4252
/* EVSYS_CHMUX3_bm Predefined. */
4253
/* EVSYS_CHMUX3_bp Predefined. */
4254
/* EVSYS_CHMUX4_bm Predefined. */
4255
/* EVSYS_CHMUX4_bp Predefined. */
4256
/* EVSYS_CHMUX5_bm Predefined. */
4257
/* EVSYS_CHMUX5_bp Predefined. */
4258
/* EVSYS_CHMUX6_bm Predefined. */
4259
/* EVSYS_CHMUX6_bp Predefined. */
4260
/* EVSYS_CHMUX7_bm Predefined. */
4261
/* EVSYS_CHMUX7_bp Predefined. */
4264
/* EVSYS.CH4MUX bit masks and bit positions */
4265
/* EVSYS_CHMUX_gm Predefined. */
4266
/* EVSYS_CHMUX_gp Predefined. */
4267
/* EVSYS_CHMUX0_bm Predefined. */
4268
/* EVSYS_CHMUX0_bp Predefined. */
4269
/* EVSYS_CHMUX1_bm Predefined. */
4270
/* EVSYS_CHMUX1_bp Predefined. */
4271
/* EVSYS_CHMUX2_bm Predefined. */
4272
/* EVSYS_CHMUX2_bp Predefined. */
4273
/* EVSYS_CHMUX3_bm Predefined. */
4274
/* EVSYS_CHMUX3_bp Predefined. */
4275
/* EVSYS_CHMUX4_bm Predefined. */
4276
/* EVSYS_CHMUX4_bp Predefined. */
4277
/* EVSYS_CHMUX5_bm Predefined. */
4278
/* EVSYS_CHMUX5_bp Predefined. */
4279
/* EVSYS_CHMUX6_bm Predefined. */
4280
/* EVSYS_CHMUX6_bp Predefined. */
4281
/* EVSYS_CHMUX7_bm Predefined. */
4282
/* EVSYS_CHMUX7_bp Predefined. */
4285
/* EVSYS.CH5MUX bit masks and bit positions */
4286
/* EVSYS_CHMUX_gm Predefined. */
4287
/* EVSYS_CHMUX_gp Predefined. */
4288
/* EVSYS_CHMUX0_bm Predefined. */
4289
/* EVSYS_CHMUX0_bp Predefined. */
4290
/* EVSYS_CHMUX1_bm Predefined. */
4291
/* EVSYS_CHMUX1_bp Predefined. */
4292
/* EVSYS_CHMUX2_bm Predefined. */
4293
/* EVSYS_CHMUX2_bp Predefined. */
4294
/* EVSYS_CHMUX3_bm Predefined. */
4295
/* EVSYS_CHMUX3_bp Predefined. */
4296
/* EVSYS_CHMUX4_bm Predefined. */
4297
/* EVSYS_CHMUX4_bp Predefined. */
4298
/* EVSYS_CHMUX5_bm Predefined. */
4299
/* EVSYS_CHMUX5_bp Predefined. */
4300
/* EVSYS_CHMUX6_bm Predefined. */
4301
/* EVSYS_CHMUX6_bp Predefined. */
4302
/* EVSYS_CHMUX7_bm Predefined. */
4303
/* EVSYS_CHMUX7_bp Predefined. */
4306
/* EVSYS.CH6MUX bit masks and bit positions */
4307
/* EVSYS_CHMUX_gm Predefined. */
4308
/* EVSYS_CHMUX_gp Predefined. */
4309
/* EVSYS_CHMUX0_bm Predefined. */
4310
/* EVSYS_CHMUX0_bp Predefined. */
4311
/* EVSYS_CHMUX1_bm Predefined. */
4312
/* EVSYS_CHMUX1_bp Predefined. */
4313
/* EVSYS_CHMUX2_bm Predefined. */
4314
/* EVSYS_CHMUX2_bp Predefined. */
4315
/* EVSYS_CHMUX3_bm Predefined. */
4316
/* EVSYS_CHMUX3_bp Predefined. */
4317
/* EVSYS_CHMUX4_bm Predefined. */
4318
/* EVSYS_CHMUX4_bp Predefined. */
4319
/* EVSYS_CHMUX5_bm Predefined. */
4320
/* EVSYS_CHMUX5_bp Predefined. */
4321
/* EVSYS_CHMUX6_bm Predefined. */
4322
/* EVSYS_CHMUX6_bp Predefined. */
4323
/* EVSYS_CHMUX7_bm Predefined. */
4324
/* EVSYS_CHMUX7_bp Predefined. */
4327
/* EVSYS.CH7MUX bit masks and bit positions */
4328
/* EVSYS_CHMUX_gm Predefined. */
4329
/* EVSYS_CHMUX_gp Predefined. */
4330
/* EVSYS_CHMUX0_bm Predefined. */
4331
/* EVSYS_CHMUX0_bp Predefined. */
4332
/* EVSYS_CHMUX1_bm Predefined. */
4333
/* EVSYS_CHMUX1_bp Predefined. */
4334
/* EVSYS_CHMUX2_bm Predefined. */
4335
/* EVSYS_CHMUX2_bp Predefined. */
4336
/* EVSYS_CHMUX3_bm Predefined. */
4337
/* EVSYS_CHMUX3_bp Predefined. */
4338
/* EVSYS_CHMUX4_bm Predefined. */
4339
/* EVSYS_CHMUX4_bp Predefined. */
4340
/* EVSYS_CHMUX5_bm Predefined. */
4341
/* EVSYS_CHMUX5_bp Predefined. */
4342
/* EVSYS_CHMUX6_bm Predefined. */
4343
/* EVSYS_CHMUX6_bp Predefined. */
4344
/* EVSYS_CHMUX7_bm Predefined. */
4345
/* EVSYS_CHMUX7_bp Predefined. */
4348
/* EVSYS.CH0CTRL bit masks and bit positions */
4349
#define EVSYS_QDIRM_gm 0x60 /* Quadrature Decoder Index Recognition Mode group mask. */
4350
#define EVSYS_QDIRM_gp 5 /* Quadrature Decoder Index Recognition Mode group position. */
4351
#define EVSYS_QDIRM0_bm (1<<5) /* Quadrature Decoder Index Recognition Mode bit 0 mask. */
4352
#define EVSYS_QDIRM0_bp 5 /* Quadrature Decoder Index Recognition Mode bit 0 position. */
4353
#define EVSYS_QDIRM1_bm (1<<6) /* Quadrature Decoder Index Recognition Mode bit 1 mask. */
4354
#define EVSYS_QDIRM1_bp 6 /* Quadrature Decoder Index Recognition Mode bit 1 position. */
4356
#define EVSYS_QDIEN_bm 0x10 /* Quadrature Decoder Index Enable bit mask. */
4357
#define EVSYS_QDIEN_bp 4 /* Quadrature Decoder Index Enable bit position. */
4359
#define EVSYS_QDEN_bm 0x08 /* Quadrature Decoder Enable bit mask. */
4360
#define EVSYS_QDEN_bp 3 /* Quadrature Decoder Enable bit position. */
4362
#define EVSYS_DIGFILT_gm 0x07 /* Digital Filter group mask. */
4363
#define EVSYS_DIGFILT_gp 0 /* Digital Filter group position. */
4364
#define EVSYS_DIGFILT0_bm (1<<0) /* Digital Filter bit 0 mask. */
4365
#define EVSYS_DIGFILT0_bp 0 /* Digital Filter bit 0 position. */
4366
#define EVSYS_DIGFILT1_bm (1<<1) /* Digital Filter bit 1 mask. */
4367
#define EVSYS_DIGFILT1_bp 1 /* Digital Filter bit 1 position. */
4368
#define EVSYS_DIGFILT2_bm (1<<2) /* Digital Filter bit 2 mask. */
4369
#define EVSYS_DIGFILT2_bp 2 /* Digital Filter bit 2 position. */
4372
/* EVSYS.CH1CTRL bit masks and bit positions */
4373
/* EVSYS_DIGFILT_gm Predefined. */
4374
/* EVSYS_DIGFILT_gp Predefined. */
4375
/* EVSYS_DIGFILT0_bm Predefined. */
4376
/* EVSYS_DIGFILT0_bp Predefined. */
4377
/* EVSYS_DIGFILT1_bm Predefined. */
4378
/* EVSYS_DIGFILT1_bp Predefined. */
4379
/* EVSYS_DIGFILT2_bm Predefined. */
4380
/* EVSYS_DIGFILT2_bp Predefined. */
4383
/* EVSYS.CH2CTRL bit masks and bit positions */
4384
/* EVSYS_QDIRM_gm Predefined. */
4385
/* EVSYS_QDIRM_gp Predefined. */
4386
/* EVSYS_QDIRM0_bm Predefined. */
4387
/* EVSYS_QDIRM0_bp Predefined. */
4388
/* EVSYS_QDIRM1_bm Predefined. */
4389
/* EVSYS_QDIRM1_bp Predefined. */
4391
/* EVSYS_QDIEN_bm Predefined. */
4392
/* EVSYS_QDIEN_bp Predefined. */
4394
/* EVSYS_QDEN_bm Predefined. */
4395
/* EVSYS_QDEN_bp Predefined. */
4397
/* EVSYS_DIGFILT_gm Predefined. */
4398
/* EVSYS_DIGFILT_gp Predefined. */
4399
/* EVSYS_DIGFILT0_bm Predefined. */
4400
/* EVSYS_DIGFILT0_bp Predefined. */
4401
/* EVSYS_DIGFILT1_bm Predefined. */
4402
/* EVSYS_DIGFILT1_bp Predefined. */
4403
/* EVSYS_DIGFILT2_bm Predefined. */
4404
/* EVSYS_DIGFILT2_bp Predefined. */
4407
/* EVSYS.CH3CTRL bit masks and bit positions */
4408
/* EVSYS_DIGFILT_gm Predefined. */
4409
/* EVSYS_DIGFILT_gp Predefined. */
4410
/* EVSYS_DIGFILT0_bm Predefined. */
4411
/* EVSYS_DIGFILT0_bp Predefined. */
4412
/* EVSYS_DIGFILT1_bm Predefined. */
4413
/* EVSYS_DIGFILT1_bp Predefined. */
4414
/* EVSYS_DIGFILT2_bm Predefined. */
4415
/* EVSYS_DIGFILT2_bp Predefined. */
4418
/* EVSYS.CH4CTRL bit masks and bit positions */
4419
/* EVSYS_QDIRM_gm Predefined. */
4420
/* EVSYS_QDIRM_gp Predefined. */
4421
/* EVSYS_QDIRM0_bm Predefined. */
4422
/* EVSYS_QDIRM0_bp Predefined. */
4423
/* EVSYS_QDIRM1_bm Predefined. */
4424
/* EVSYS_QDIRM1_bp Predefined. */
4426
/* EVSYS_QDIEN_bm Predefined. */
4427
/* EVSYS_QDIEN_bp Predefined. */
4429
/* EVSYS_QDEN_bm Predefined. */
4430
/* EVSYS_QDEN_bp Predefined. */
4432
/* EVSYS_DIGFILT_gm Predefined. */
4433
/* EVSYS_DIGFILT_gp Predefined. */
4434
/* EVSYS_DIGFILT0_bm Predefined. */
4435
/* EVSYS_DIGFILT0_bp Predefined. */
4436
/* EVSYS_DIGFILT1_bm Predefined. */
4437
/* EVSYS_DIGFILT1_bp Predefined. */
4438
/* EVSYS_DIGFILT2_bm Predefined. */
4439
/* EVSYS_DIGFILT2_bp Predefined. */
4442
/* EVSYS.CH5CTRL bit masks and bit positions */
4443
/* EVSYS_DIGFILT_gm Predefined. */
4444
/* EVSYS_DIGFILT_gp Predefined. */
4445
/* EVSYS_DIGFILT0_bm Predefined. */
4446
/* EVSYS_DIGFILT0_bp Predefined. */
4447
/* EVSYS_DIGFILT1_bm Predefined. */
4448
/* EVSYS_DIGFILT1_bp Predefined. */
4449
/* EVSYS_DIGFILT2_bm Predefined. */
4450
/* EVSYS_DIGFILT2_bp Predefined. */
4453
/* EVSYS.CH6CTRL bit masks and bit positions */
4454
/* EVSYS_DIGFILT_gm Predefined. */
4455
/* EVSYS_DIGFILT_gp Predefined. */
4456
/* EVSYS_DIGFILT0_bm Predefined. */
4457
/* EVSYS_DIGFILT0_bp Predefined. */
4458
/* EVSYS_DIGFILT1_bm Predefined. */
4459
/* EVSYS_DIGFILT1_bp Predefined. */
4460
/* EVSYS_DIGFILT2_bm Predefined. */
4461
/* EVSYS_DIGFILT2_bp Predefined. */
4464
/* EVSYS.CH7CTRL bit masks and bit positions */
4465
/* EVSYS_DIGFILT_gm Predefined. */
4466
/* EVSYS_DIGFILT_gp Predefined. */
4467
/* EVSYS_DIGFILT0_bm Predefined. */
4468
/* EVSYS_DIGFILT0_bp Predefined. */
4469
/* EVSYS_DIGFILT1_bm Predefined. */
4470
/* EVSYS_DIGFILT1_bp Predefined. */
4471
/* EVSYS_DIGFILT2_bm Predefined. */
4472
/* EVSYS_DIGFILT2_bp Predefined. */
4475
/* NVM - Non Volatile Memory Controller */
4476
/* NVM.CMD bit masks and bit positions */
4477
#define NVM_CMD_gm 0xFF /* Command group mask. */
4478
#define NVM_CMD_gp 0 /* Command group position. */
4479
#define NVM_CMD0_bm (1<<0) /* Command bit 0 mask. */
4480
#define NVM_CMD0_bp 0 /* Command bit 0 position. */
4481
#define NVM_CMD1_bm (1<<1) /* Command bit 1 mask. */
4482
#define NVM_CMD1_bp 1 /* Command bit 1 position. */
4483
#define NVM_CMD2_bm (1<<2) /* Command bit 2 mask. */
4484
#define NVM_CMD2_bp 2 /* Command bit 2 position. */
4485
#define NVM_CMD3_bm (1<<3) /* Command bit 3 mask. */
4486
#define NVM_CMD3_bp 3 /* Command bit 3 position. */
4487
#define NVM_CMD4_bm (1<<4) /* Command bit 4 mask. */
4488
#define NVM_CMD4_bp 4 /* Command bit 4 position. */
4489
#define NVM_CMD5_bm (1<<5) /* Command bit 5 mask. */
4490
#define NVM_CMD5_bp 5 /* Command bit 5 position. */
4491
#define NVM_CMD6_bm (1<<6) /* Command bit 6 mask. */
4492
#define NVM_CMD6_bp 6 /* Command bit 6 position. */
4493
#define NVM_CMD7_bm (1<<7) /* Command bit 7 mask. */
4494
#define NVM_CMD7_bp 7 /* Command bit 7 position. */
4497
/* NVM.CTRLA bit masks and bit positions */
4498
#define NVM_CMDEX_bm 0x01 /* Command Execute bit mask. */
4499
#define NVM_CMDEX_bp 0 /* Command Execute bit position. */
4502
/* NVM.CTRLB bit masks and bit positions */
4503
#define NVM_EEMAPEN_bm 0x08 /* EEPROM Mapping Enable bit mask. */
4504
#define NVM_EEMAPEN_bp 3 /* EEPROM Mapping Enable bit position. */
4506
#define NVM_FPRM_bm 0x04 /* Flash Power Reduction Enable bit mask. */
4507
#define NVM_FPRM_bp 2 /* Flash Power Reduction Enable bit position. */
4509
#define NVM_EPRM_bm 0x02 /* EEPROM Power Reduction Enable bit mask. */
4510
#define NVM_EPRM_bp 1 /* EEPROM Power Reduction Enable bit position. */
4512
#define NVM_SPMLOCK_bm 0x01 /* SPM Lock bit mask. */
4513
#define NVM_SPMLOCK_bp 0 /* SPM Lock bit position. */
4516
/* NVM.INTCTRL bit masks and bit positions */
4517
#define NVM_SPMLVL_gm 0x0C /* SPM Interrupt Level group mask. */
4518
#define NVM_SPMLVL_gp 2 /* SPM Interrupt Level group position. */
4519
#define NVM_SPMLVL0_bm (1<<2) /* SPM Interrupt Level bit 0 mask. */
4520
#define NVM_SPMLVL0_bp 2 /* SPM Interrupt Level bit 0 position. */
4521
#define NVM_SPMLVL1_bm (1<<3) /* SPM Interrupt Level bit 1 mask. */
4522
#define NVM_SPMLVL1_bp 3 /* SPM Interrupt Level bit 1 position. */
4524
#define NVM_EELVL_gm 0x03 /* EEPROM Interrupt Level group mask. */
4525
#define NVM_EELVL_gp 0 /* EEPROM Interrupt Level group position. */
4526
#define NVM_EELVL0_bm (1<<0) /* EEPROM Interrupt Level bit 0 mask. */
4527
#define NVM_EELVL0_bp 0 /* EEPROM Interrupt Level bit 0 position. */
4528
#define NVM_EELVL1_bm (1<<1) /* EEPROM Interrupt Level bit 1 mask. */
4529
#define NVM_EELVL1_bp 1 /* EEPROM Interrupt Level bit 1 position. */
4532
/* NVM.STATUS bit masks and bit positions */
4533
#define NVM_NVMBUSY_bm 0x80 /* Non-volatile Memory Busy bit mask. */
4534
#define NVM_NVMBUSY_bp 7 /* Non-volatile Memory Busy bit position. */
4536
#define NVM_FBUSY_bm 0x40 /* Flash Memory Busy bit mask. */
4537
#define NVM_FBUSY_bp 6 /* Flash Memory Busy bit position. */
4539
#define NVM_EELOAD_bm 0x02 /* EEPROM Page Buffer Active Loading bit mask. */
4540
#define NVM_EELOAD_bp 1 /* EEPROM Page Buffer Active Loading bit position. */
4542
#define NVM_FLOAD_bm 0x01 /* Flash Page Buffer Active Loading bit mask. */
4543
#define NVM_FLOAD_bp 0 /* Flash Page Buffer Active Loading bit position. */
4546
/* NVM.LOCKBITS bit masks and bit positions */
4547
#define NVM_BLBB_gm 0xC0 /* Boot Lock Bits - Boot Section group mask. */
4548
#define NVM_BLBB_gp 6 /* Boot Lock Bits - Boot Section group position. */
4549
#define NVM_BLBB0_bm (1<<6) /* Boot Lock Bits - Boot Section bit 0 mask. */
4550
#define NVM_BLBB0_bp 6 /* Boot Lock Bits - Boot Section bit 0 position. */
4551
#define NVM_BLBB1_bm (1<<7) /* Boot Lock Bits - Boot Section bit 1 mask. */
4552
#define NVM_BLBB1_bp 7 /* Boot Lock Bits - Boot Section bit 1 position. */
4554
#define NVM_BLBA_gm 0x30 /* Boot Lock Bits - Application Section group mask. */
4555
#define NVM_BLBA_gp 4 /* Boot Lock Bits - Application Section group position. */
4556
#define NVM_BLBA0_bm (1<<4) /* Boot Lock Bits - Application Section bit 0 mask. */
4557
#define NVM_BLBA0_bp 4 /* Boot Lock Bits - Application Section bit 0 position. */
4558
#define NVM_BLBA1_bm (1<<5) /* Boot Lock Bits - Application Section bit 1 mask. */
4559
#define NVM_BLBA1_bp 5 /* Boot Lock Bits - Application Section bit 1 position. */
4561
#define NVM_BLBAT_gm 0x0C /* Boot Lock Bits - Application Table group mask. */
4562
#define NVM_BLBAT_gp 2 /* Boot Lock Bits - Application Table group position. */
4563
#define NVM_BLBAT0_bm (1<<2) /* Boot Lock Bits - Application Table bit 0 mask. */
4564
#define NVM_BLBAT0_bp 2 /* Boot Lock Bits - Application Table bit 0 position. */
4565
#define NVM_BLBAT1_bm (1<<3) /* Boot Lock Bits - Application Table bit 1 mask. */
4566
#define NVM_BLBAT1_bp 3 /* Boot Lock Bits - Application Table bit 1 position. */
4568
#define NVM_LB_gm 0x03 /* Lock Bits group mask. */
4569
#define NVM_LB_gp 0 /* Lock Bits group position. */
4570
#define NVM_LB0_bm (1<<0) /* Lock Bits bit 0 mask. */
4571
#define NVM_LB0_bp 0 /* Lock Bits bit 0 position. */
4572
#define NVM_LB1_bm (1<<1) /* Lock Bits bit 1 mask. */
4573
#define NVM_LB1_bp 1 /* Lock Bits bit 1 position. */
4576
/* NVM_LOCKBITS.LOCKBITS bit masks and bit positions */
4577
#define NVM_LOCKBITS_BLBB_gm 0xC0 /* Boot Lock Bits - Boot Section group mask. */
4578
#define NVM_LOCKBITS_BLBB_gp 6 /* Boot Lock Bits - Boot Section group position. */
4579
#define NVM_LOCKBITS_BLBB0_bm (1<<6) /* Boot Lock Bits - Boot Section bit 0 mask. */
4580
#define NVM_LOCKBITS_BLBB0_bp 6 /* Boot Lock Bits - Boot Section bit 0 position. */
4581
#define NVM_LOCKBITS_BLBB1_bm (1<<7) /* Boot Lock Bits - Boot Section bit 1 mask. */
4582
#define NVM_LOCKBITS_BLBB1_bp 7 /* Boot Lock Bits - Boot Section bit 1 position. */
4584
#define NVM_LOCKBITS_BLBA_gm 0x30 /* Boot Lock Bits - Application Section group mask. */
4585
#define NVM_LOCKBITS_BLBA_gp 4 /* Boot Lock Bits - Application Section group position. */
4586
#define NVM_LOCKBITS_BLBA0_bm (1<<4) /* Boot Lock Bits - Application Section bit 0 mask. */
4587
#define NVM_LOCKBITS_BLBA0_bp 4 /* Boot Lock Bits - Application Section bit 0 position. */
4588
#define NVM_LOCKBITS_BLBA1_bm (1<<5) /* Boot Lock Bits - Application Section bit 1 mask. */
4589
#define NVM_LOCKBITS_BLBA1_bp 5 /* Boot Lock Bits - Application Section bit 1 position. */
4591
#define NVM_LOCKBITS_BLBAT_gm 0x0C /* Boot Lock Bits - Application Table group mask. */
4592
#define NVM_LOCKBITS_BLBAT_gp 2 /* Boot Lock Bits - Application Table group position. */
4593
#define NVM_LOCKBITS_BLBAT0_bm (1<<2) /* Boot Lock Bits - Application Table bit 0 mask. */
4594
#define NVM_LOCKBITS_BLBAT0_bp 2 /* Boot Lock Bits - Application Table bit 0 position. */
4595
#define NVM_LOCKBITS_BLBAT1_bm (1<<3) /* Boot Lock Bits - Application Table bit 1 mask. */
4596
#define NVM_LOCKBITS_BLBAT1_bp 3 /* Boot Lock Bits - Application Table bit 1 position. */
4598
#define NVM_LOCKBITS_LB_gm 0x03 /* Lock Bits group mask. */
4599
#define NVM_LOCKBITS_LB_gp 0 /* Lock Bits group position. */
4600
#define NVM_LOCKBITS_LB0_bm (1<<0) /* Lock Bits bit 0 mask. */
4601
#define NVM_LOCKBITS_LB0_bp 0 /* Lock Bits bit 0 position. */
4602
#define NVM_LOCKBITS_LB1_bm (1<<1) /* Lock Bits bit 1 mask. */
4603
#define NVM_LOCKBITS_LB1_bp 1 /* Lock Bits bit 1 position. */
4606
/* NVM_FUSES.FUSEBYTE0 bit masks and bit positions */
4607
#define NVM_FUSES_JTAGUSERID_gm 0xFF /* JTAG User ID group mask. */
4608
#define NVM_FUSES_JTAGUSERID_gp 0 /* JTAG User ID group position. */
4609
#define NVM_FUSES_JTAGUSERID0_bm (1<<0) /* JTAG User ID bit 0 mask. */
4610
#define NVM_FUSES_JTAGUSERID0_bp 0 /* JTAG User ID bit 0 position. */
4611
#define NVM_FUSES_JTAGUSERID1_bm (1<<1) /* JTAG User ID bit 1 mask. */
4612
#define NVM_FUSES_JTAGUSERID1_bp 1 /* JTAG User ID bit 1 position. */
4613
#define NVM_FUSES_JTAGUSERID2_bm (1<<2) /* JTAG User ID bit 2 mask. */
4614
#define NVM_FUSES_JTAGUSERID2_bp 2 /* JTAG User ID bit 2 position. */
4615
#define NVM_FUSES_JTAGUSERID3_bm (1<<3) /* JTAG User ID bit 3 mask. */
4616
#define NVM_FUSES_JTAGUSERID3_bp 3 /* JTAG User ID bit 3 position. */
4617
#define NVM_FUSES_JTAGUSERID4_bm (1<<4) /* JTAG User ID bit 4 mask. */
4618
#define NVM_FUSES_JTAGUSERID4_bp 4 /* JTAG User ID bit 4 position. */
4619
#define NVM_FUSES_JTAGUSERID5_bm (1<<5) /* JTAG User ID bit 5 mask. */
4620
#define NVM_FUSES_JTAGUSERID5_bp 5 /* JTAG User ID bit 5 position. */
4621
#define NVM_FUSES_JTAGUSERID6_bm (1<<6) /* JTAG User ID bit 6 mask. */
4622
#define NVM_FUSES_JTAGUSERID6_bp 6 /* JTAG User ID bit 6 position. */
4623
#define NVM_FUSES_JTAGUSERID7_bm (1<<7) /* JTAG User ID bit 7 mask. */
4624
#define NVM_FUSES_JTAGUSERID7_bp 7 /* JTAG User ID bit 7 position. */
4627
/* NVM_FUSES.FUSEBYTE1 bit masks and bit positions */
4628
#define NVM_FUSES_WDWP_gm 0xF0 /* Watchdog Window Timeout Period group mask. */
4629
#define NVM_FUSES_WDWP_gp 4 /* Watchdog Window Timeout Period group position. */
4630
#define NVM_FUSES_WDWP0_bm (1<<4) /* Watchdog Window Timeout Period bit 0 mask. */
4631
#define NVM_FUSES_WDWP0_bp 4 /* Watchdog Window Timeout Period bit 0 position. */
4632
#define NVM_FUSES_WDWP1_bm (1<<5) /* Watchdog Window Timeout Period bit 1 mask. */
4633
#define NVM_FUSES_WDWP1_bp 5 /* Watchdog Window Timeout Period bit 1 position. */
4634
#define NVM_FUSES_WDWP2_bm (1<<6) /* Watchdog Window Timeout Period bit 2 mask. */
4635
#define NVM_FUSES_WDWP2_bp 6 /* Watchdog Window Timeout Period bit 2 position. */
4636
#define NVM_FUSES_WDWP3_bm (1<<7) /* Watchdog Window Timeout Period bit 3 mask. */
4637
#define NVM_FUSES_WDWP3_bp 7 /* Watchdog Window Timeout Period bit 3 position. */
4639
#define NVM_FUSES_WDP_gm 0x0F /* Watchdog Timeout Period group mask. */
4640
#define NVM_FUSES_WDP_gp 0 /* Watchdog Timeout Period group position. */
4641
#define NVM_FUSES_WDP0_bm (1<<0) /* Watchdog Timeout Period bit 0 mask. */
4642
#define NVM_FUSES_WDP0_bp 0 /* Watchdog Timeout Period bit 0 position. */
4643
#define NVM_FUSES_WDP1_bm (1<<1) /* Watchdog Timeout Period bit 1 mask. */
4644
#define NVM_FUSES_WDP1_bp 1 /* Watchdog Timeout Period bit 1 position. */
4645
#define NVM_FUSES_WDP2_bm (1<<2) /* Watchdog Timeout Period bit 2 mask. */
4646
#define NVM_FUSES_WDP2_bp 2 /* Watchdog Timeout Period bit 2 position. */
4647
#define NVM_FUSES_WDP3_bm (1<<3) /* Watchdog Timeout Period bit 3 mask. */
4648
#define NVM_FUSES_WDP3_bp 3 /* Watchdog Timeout Period bit 3 position. */
4651
/* NVM_FUSES.FUSEBYTE2 bit masks and bit positions */
4652
#define NVM_FUSES_DVSDON_bm 0x80 /* Spike Detector Enable bit mask. */
4653
#define NVM_FUSES_DVSDON_bp 7 /* Spike Detector Enable bit position. */
4655
#define NVM_FUSES_BOOTRST_bm 0x40 /* Boot Loader Section Reset Vector bit mask. */
4656
#define NVM_FUSES_BOOTRST_bp 6 /* Boot Loader Section Reset Vector bit position. */
4658
#define NVM_FUSES_BODPD_gm 0x03 /* BOD Operation in Power-Down Mode group mask. */
4659
#define NVM_FUSES_BODPD_gp 0 /* BOD Operation in Power-Down Mode group position. */
4660
#define NVM_FUSES_BODPD0_bm (1<<0) /* BOD Operation in Power-Down Mode bit 0 mask. */
4661
#define NVM_FUSES_BODPD0_bp 0 /* BOD Operation in Power-Down Mode bit 0 position. */
4662
#define NVM_FUSES_BODPD1_bm (1<<1) /* BOD Operation in Power-Down Mode bit 1 mask. */
4663
#define NVM_FUSES_BODPD1_bp 1 /* BOD Operation in Power-Down Mode bit 1 position. */
4666
/* NVM_FUSES.FUSEBYTE4 bit masks and bit positions */
4667
#define NVM_FUSES_SUT_gm 0x0C /* Start-up Time group mask. */
4668
#define NVM_FUSES_SUT_gp 2 /* Start-up Time group position. */
4669
#define NVM_FUSES_SUT0_bm (1<<2) /* Start-up Time bit 0 mask. */
4670
#define NVM_FUSES_SUT0_bp 2 /* Start-up Time bit 0 position. */
4671
#define NVM_FUSES_SUT1_bm (1<<3) /* Start-up Time bit 1 mask. */
4672
#define NVM_FUSES_SUT1_bp 3 /* Start-up Time bit 1 position. */
4674
#define NVM_FUSES_WDLOCK_bm 0x02 /* Watchdog Timer Lock bit mask. */
4675
#define NVM_FUSES_WDLOCK_bp 1 /* Watchdog Timer Lock bit position. */
4677
#define NVM_FUSES_JTAGEN_bm 0x01 /* JTAG Interface Enable bit mask. */
4678
#define NVM_FUSES_JTAGEN_bp 0 /* JTAG Interface Enable bit position. */
4681
/* NVM_FUSES.FUSEBYTE5 bit masks and bit positions */
4682
#define NVM_FUSES_BODACT_gm 0x30 /* BOD Operation in Active Mode group mask. */
4683
#define NVM_FUSES_BODACT_gp 4 /* BOD Operation in Active Mode group position. */
4684
#define NVM_FUSES_BODACT0_bm (1<<4) /* BOD Operation in Active Mode bit 0 mask. */
4685
#define NVM_FUSES_BODACT0_bp 4 /* BOD Operation in Active Mode bit 0 position. */
4686
#define NVM_FUSES_BODACT1_bm (1<<5) /* BOD Operation in Active Mode bit 1 mask. */
4687
#define NVM_FUSES_BODACT1_bp 5 /* BOD Operation in Active Mode bit 1 position. */
4689
#define NVM_FUSES_EESAVE_bm 0x08 /* Preserve EEPROM Through Chip Erase bit mask. */
4690
#define NVM_FUSES_EESAVE_bp 3 /* Preserve EEPROM Through Chip Erase bit position. */
4692
#define NVM_FUSES_BODLVL_gm 0x07 /* Brown Out Detection Voltage Level group mask. */
4693
#define NVM_FUSES_BODLVL_gp 0 /* Brown Out Detection Voltage Level group position. */
4694
#define NVM_FUSES_BODLVL0_bm (1<<0) /* Brown Out Detection Voltage Level bit 0 mask. */
4695
#define NVM_FUSES_BODLVL0_bp 0 /* Brown Out Detection Voltage Level bit 0 position. */
4696
#define NVM_FUSES_BODLVL1_bm (1<<1) /* Brown Out Detection Voltage Level bit 1 mask. */
4697
#define NVM_FUSES_BODLVL1_bp 1 /* Brown Out Detection Voltage Level bit 1 position. */
4698
#define NVM_FUSES_BODLVL2_bm (1<<2) /* Brown Out Detection Voltage Level bit 2 mask. */
4699
#define NVM_FUSES_BODLVL2_bp 2 /* Brown Out Detection Voltage Level bit 2 position. */
4702
/* AC - Analog Comparator */
4703
/* AC.AC0CTRL bit masks and bit positions */
4704
#define AC_INTMODE_gm 0xC0 /* Interrupt Mode group mask. */
4705
#define AC_INTMODE_gp 6 /* Interrupt Mode group position. */
4706
#define AC_INTMODE0_bm (1<<6) /* Interrupt Mode bit 0 mask. */
4707
#define AC_INTMODE0_bp 6 /* Interrupt Mode bit 0 position. */
4708
#define AC_INTMODE1_bm (1<<7) /* Interrupt Mode bit 1 mask. */
4709
#define AC_INTMODE1_bp 7 /* Interrupt Mode bit 1 position. */
4711
#define AC_INTLVL_gm 0x30 /* Interrupt Level group mask. */
4712
#define AC_INTLVL_gp 4 /* Interrupt Level group position. */
4713
#define AC_INTLVL0_bm (1<<4) /* Interrupt Level bit 0 mask. */
4714
#define AC_INTLVL0_bp 4 /* Interrupt Level bit 0 position. */
4715
#define AC_INTLVL1_bm (1<<5) /* Interrupt Level bit 1 mask. */
4716
#define AC_INTLVL1_bp 5 /* Interrupt Level bit 1 position. */
4718
#define AC_HSMODE_bm 0x08 /* High-speed Mode bit mask. */
4719
#define AC_HSMODE_bp 3 /* High-speed Mode bit position. */
4721
#define AC_HYSMODE_gm 0x06 /* Hysteresis Mode group mask. */
4722
#define AC_HYSMODE_gp 1 /* Hysteresis Mode group position. */
4723
#define AC_HYSMODE0_bm (1<<1) /* Hysteresis Mode bit 0 mask. */
4724
#define AC_HYSMODE0_bp 1 /* Hysteresis Mode bit 0 position. */
4725
#define AC_HYSMODE1_bm (1<<2) /* Hysteresis Mode bit 1 mask. */
4726
#define AC_HYSMODE1_bp 2 /* Hysteresis Mode bit 1 position. */
4728
#define AC_ENABLE_bm 0x01 /* Enable bit mask. */
4729
#define AC_ENABLE_bp 0 /* Enable bit position. */
4732
/* AC.AC1CTRL bit masks and bit positions */
4733
/* AC_INTMODE_gm Predefined. */
4734
/* AC_INTMODE_gp Predefined. */
4735
/* AC_INTMODE0_bm Predefined. */
4736
/* AC_INTMODE0_bp Predefined. */
4737
/* AC_INTMODE1_bm Predefined. */
4738
/* AC_INTMODE1_bp Predefined. */
4740
/* AC_INTLVL_gm Predefined. */
4741
/* AC_INTLVL_gp Predefined. */
4742
/* AC_INTLVL0_bm Predefined. */
4743
/* AC_INTLVL0_bp Predefined. */
4744
/* AC_INTLVL1_bm Predefined. */
4745
/* AC_INTLVL1_bp Predefined. */
4747
/* AC_HSMODE_bm Predefined. */
4748
/* AC_HSMODE_bp Predefined. */
4750
/* AC_HYSMODE_gm Predefined. */
4751
/* AC_HYSMODE_gp Predefined. */
4752
/* AC_HYSMODE0_bm Predefined. */
4753
/* AC_HYSMODE0_bp Predefined. */
4754
/* AC_HYSMODE1_bm Predefined. */
4755
/* AC_HYSMODE1_bp Predefined. */
4757
/* AC_ENABLE_bm Predefined. */
4758
/* AC_ENABLE_bp Predefined. */
4761
/* AC.AC0MUXCTRL bit masks and bit positions */
4762
#define AC_MUXPOS_gm 0x38 /* MUX Positive Input group mask. */
4763
#define AC_MUXPOS_gp 3 /* MUX Positive Input group position. */
4764
#define AC_MUXPOS0_bm (1<<3) /* MUX Positive Input bit 0 mask. */
4765
#define AC_MUXPOS0_bp 3 /* MUX Positive Input bit 0 position. */
4766
#define AC_MUXPOS1_bm (1<<4) /* MUX Positive Input bit 1 mask. */
4767
#define AC_MUXPOS1_bp 4 /* MUX Positive Input bit 1 position. */
4768
#define AC_MUXPOS2_bm (1<<5) /* MUX Positive Input bit 2 mask. */
4769
#define AC_MUXPOS2_bp 5 /* MUX Positive Input bit 2 position. */
4771
#define AC_MUXNEG_gm 0x07 /* MUX Negative Input group mask. */
4772
#define AC_MUXNEG_gp 0 /* MUX Negative Input group position. */
4773
#define AC_MUXNEG0_bm (1<<0) /* MUX Negative Input bit 0 mask. */
4774
#define AC_MUXNEG0_bp 0 /* MUX Negative Input bit 0 position. */
4775
#define AC_MUXNEG1_bm (1<<1) /* MUX Negative Input bit 1 mask. */
4776
#define AC_MUXNEG1_bp 1 /* MUX Negative Input bit 1 position. */
4777
#define AC_MUXNEG2_bm (1<<2) /* MUX Negative Input bit 2 mask. */
4778
#define AC_MUXNEG2_bp 2 /* MUX Negative Input bit 2 position. */
4781
/* AC.AC1MUXCTRL bit masks and bit positions */
4782
/* AC_MUXPOS_gm Predefined. */
4783
/* AC_MUXPOS_gp Predefined. */
4784
/* AC_MUXPOS0_bm Predefined. */
4785
/* AC_MUXPOS0_bp Predefined. */
4786
/* AC_MUXPOS1_bm Predefined. */
4787
/* AC_MUXPOS1_bp Predefined. */
4788
/* AC_MUXPOS2_bm Predefined. */
4789
/* AC_MUXPOS2_bp Predefined. */
4791
/* AC_MUXNEG_gm Predefined. */
4792
/* AC_MUXNEG_gp Predefined. */
4793
/* AC_MUXNEG0_bm Predefined. */
4794
/* AC_MUXNEG0_bp Predefined. */
4795
/* AC_MUXNEG1_bm Predefined. */
4796
/* AC_MUXNEG1_bp Predefined. */
4797
/* AC_MUXNEG2_bm Predefined. */
4798
/* AC_MUXNEG2_bp Predefined. */
4801
/* AC.CTRLA bit masks and bit positions */
4802
#define AC_AC0OUT_bm 0x01 /* Comparator 0 Output Enable bit mask. */
4803
#define AC_AC0OUT_bp 0 /* Comparator 0 Output Enable bit position. */
4806
/* AC.CTRLB bit masks and bit positions */
4807
#define AC_SCALEFAC_gm 0x3F /* VCC Voltage Scaler Factor group mask. */
4808
#define AC_SCALEFAC_gp 0 /* VCC Voltage Scaler Factor group position. */
4809
#define AC_SCALEFAC0_bm (1<<0) /* VCC Voltage Scaler Factor bit 0 mask. */
4810
#define AC_SCALEFAC0_bp 0 /* VCC Voltage Scaler Factor bit 0 position. */
4811
#define AC_SCALEFAC1_bm (1<<1) /* VCC Voltage Scaler Factor bit 1 mask. */
4812
#define AC_SCALEFAC1_bp 1 /* VCC Voltage Scaler Factor bit 1 position. */
4813
#define AC_SCALEFAC2_bm (1<<2) /* VCC Voltage Scaler Factor bit 2 mask. */
4814
#define AC_SCALEFAC2_bp 2 /* VCC Voltage Scaler Factor bit 2 position. */
4815
#define AC_SCALEFAC3_bm (1<<3) /* VCC Voltage Scaler Factor bit 3 mask. */
4816
#define AC_SCALEFAC3_bp 3 /* VCC Voltage Scaler Factor bit 3 position. */
4817
#define AC_SCALEFAC4_bm (1<<4) /* VCC Voltage Scaler Factor bit 4 mask. */
4818
#define AC_SCALEFAC4_bp 4 /* VCC Voltage Scaler Factor bit 4 position. */
4819
#define AC_SCALEFAC5_bm (1<<5) /* VCC Voltage Scaler Factor bit 5 mask. */
4820
#define AC_SCALEFAC5_bp 5 /* VCC Voltage Scaler Factor bit 5 position. */
4823
/* AC.WINCTRL bit masks and bit positions */
4824
#define AC_WEN_bm 0x10 /* Window Mode Enable bit mask. */
4825
#define AC_WEN_bp 4 /* Window Mode Enable bit position. */
4827
#define AC_WINTMODE_gm 0x0C /* Window Interrupt Mode group mask. */
4828
#define AC_WINTMODE_gp 2 /* Window Interrupt Mode group position. */
4829
#define AC_WINTMODE0_bm (1<<2) /* Window Interrupt Mode bit 0 mask. */
4830
#define AC_WINTMODE0_bp 2 /* Window Interrupt Mode bit 0 position. */
4831
#define AC_WINTMODE1_bm (1<<3) /* Window Interrupt Mode bit 1 mask. */
4832
#define AC_WINTMODE1_bp 3 /* Window Interrupt Mode bit 1 position. */
4834
#define AC_WINTLVL_gm 0x03 /* Window Interrupt Level group mask. */
4835
#define AC_WINTLVL_gp 0 /* Window Interrupt Level group position. */
4836
#define AC_WINTLVL0_bm (1<<0) /* Window Interrupt Level bit 0 mask. */
4837
#define AC_WINTLVL0_bp 0 /* Window Interrupt Level bit 0 position. */
4838
#define AC_WINTLVL1_bm (1<<1) /* Window Interrupt Level bit 1 mask. */
4839
#define AC_WINTLVL1_bp 1 /* Window Interrupt Level bit 1 position. */
4842
/* AC.STATUS bit masks and bit positions */
4843
#define AC_WSTATE_gm 0xC0 /* Window Mode State group mask. */
4844
#define AC_WSTATE_gp 6 /* Window Mode State group position. */
4845
#define AC_WSTATE0_bm (1<<6) /* Window Mode State bit 0 mask. */
4846
#define AC_WSTATE0_bp 6 /* Window Mode State bit 0 position. */
4847
#define AC_WSTATE1_bm (1<<7) /* Window Mode State bit 1 mask. */
4848
#define AC_WSTATE1_bp 7 /* Window Mode State bit 1 position. */
4850
#define AC_AC1STATE_bm 0x20 /* Comparator 1 State bit mask. */
4851
#define AC_AC1STATE_bp 5 /* Comparator 1 State bit position. */
4853
#define AC_AC0STATE_bm 0x10 /* Comparator 0 State bit mask. */
4854
#define AC_AC0STATE_bp 4 /* Comparator 0 State bit position. */
4856
#define AC_WIF_bm 0x04 /* Window Mode Interrupt Flag bit mask. */
4857
#define AC_WIF_bp 2 /* Window Mode Interrupt Flag bit position. */
4859
#define AC_AC1IF_bm 0x02 /* Comparator 1 Interrupt Flag bit mask. */
4860
#define AC_AC1IF_bp 1 /* Comparator 1 Interrupt Flag bit position. */
4862
#define AC_AC0IF_bm 0x01 /* Comparator 0 Interrupt Flag bit mask. */
4863
#define AC_AC0IF_bp 0 /* Comparator 0 Interrupt Flag bit position. */
4866
/* ADC - Analog/Digital Converter */
4867
/* ADC_CH.CTRL bit masks and bit positions */
4868
#define ADC_CH_START_bm 0x80 /* Channel Start Conversion bit mask. */
4869
#define ADC_CH_START_bp 7 /* Channel Start Conversion bit position. */
4871
#define ADC_CH_GAINFAC_gm 0x1C /* Gain Factor group mask. */
4872
#define ADC_CH_GAINFAC_gp 2 /* Gain Factor group position. */
4873
#define ADC_CH_GAINFAC0_bm (1<<2) /* Gain Factor bit 0 mask. */
4874
#define ADC_CH_GAINFAC0_bp 2 /* Gain Factor bit 0 position. */
4875
#define ADC_CH_GAINFAC1_bm (1<<3) /* Gain Factor bit 1 mask. */
4876
#define ADC_CH_GAINFAC1_bp 3 /* Gain Factor bit 1 position. */
4877
#define ADC_CH_GAINFAC2_bm (1<<4) /* Gain Factor bit 2 mask. */
4878
#define ADC_CH_GAINFAC2_bp 4 /* Gain Factor bit 2 position. */
4880
#define ADC_CH_INPUTMODE_gm 0x03 /* Input Mode Select group mask. */
4881
#define ADC_CH_INPUTMODE_gp 0 /* Input Mode Select group position. */
4882
#define ADC_CH_INPUTMODE0_bm (1<<0) /* Input Mode Select bit 0 mask. */
4883
#define ADC_CH_INPUTMODE0_bp 0 /* Input Mode Select bit 0 position. */
4884
#define ADC_CH_INPUTMODE1_bm (1<<1) /* Input Mode Select bit 1 mask. */
4885
#define ADC_CH_INPUTMODE1_bp 1 /* Input Mode Select bit 1 position. */
4888
/* ADC_CH.MUXCTRL bit masks and bit positions */
4889
#define ADC_CH_MUXPOS_gm 0x78 /* Positive Input Select group mask. */
4890
#define ADC_CH_MUXPOS_gp 3 /* Positive Input Select group position. */
4891
#define ADC_CH_MUXPOS0_bm (1<<3) /* Positive Input Select bit 0 mask. */
4892
#define ADC_CH_MUXPOS0_bp 3 /* Positive Input Select bit 0 position. */
4893
#define ADC_CH_MUXPOS1_bm (1<<4) /* Positive Input Select bit 1 mask. */
4894
#define ADC_CH_MUXPOS1_bp 4 /* Positive Input Select bit 1 position. */
4895
#define ADC_CH_MUXPOS2_bm (1<<5) /* Positive Input Select bit 2 mask. */
4896
#define ADC_CH_MUXPOS2_bp 5 /* Positive Input Select bit 2 position. */
4897
#define ADC_CH_MUXPOS3_bm (1<<6) /* Positive Input Select bit 3 mask. */
4898
#define ADC_CH_MUXPOS3_bp 6 /* Positive Input Select bit 3 position. */
4900
#define ADC_CH_MUXINT_gm 0x78 /* Internal Input Select group mask. */
4901
#define ADC_CH_MUXINT_gp 3 /* Internal Input Select group position. */
4902
#define ADC_CH_MUXINT0_bm (1<<3) /* Internal Input Select bit 0 mask. */
4903
#define ADC_CH_MUXINT0_bp 3 /* Internal Input Select bit 0 position. */
4904
#define ADC_CH_MUXINT1_bm (1<<4) /* Internal Input Select bit 1 mask. */
4905
#define ADC_CH_MUXINT1_bp 4 /* Internal Input Select bit 1 position. */
4906
#define ADC_CH_MUXINT2_bm (1<<5) /* Internal Input Select bit 2 mask. */
4907
#define ADC_CH_MUXINT2_bp 5 /* Internal Input Select bit 2 position. */
4908
#define ADC_CH_MUXINT3_bm (1<<6) /* Internal Input Select bit 3 mask. */
4909
#define ADC_CH_MUXINT3_bp 6 /* Internal Input Select bit 3 position. */
4911
#define ADC_CH_MUXNEG_gm 0x03 /* Negative Input Select group mask. */
4912
#define ADC_CH_MUXNEG_gp 0 /* Negative Input Select group position. */
4913
#define ADC_CH_MUXNEG0_bm (1<<0) /* Negative Input Select bit 0 mask. */
4914
#define ADC_CH_MUXNEG0_bp 0 /* Negative Input Select bit 0 position. */
4915
#define ADC_CH_MUXNEG1_bm (1<<1) /* Negative Input Select bit 1 mask. */
4916
#define ADC_CH_MUXNEG1_bp 1 /* Negative Input Select bit 1 position. */
4919
/* ADC_CH.INTCTRL bit masks and bit positions */
4920
#define ADC_CH_INTMODE_gm 0x0C /* Interrupt Mode group mask. */
4921
#define ADC_CH_INTMODE_gp 2 /* Interrupt Mode group position. */
4922
#define ADC_CH_INTMODE0_bm (1<<2) /* Interrupt Mode bit 0 mask. */
4923
#define ADC_CH_INTMODE0_bp 2 /* Interrupt Mode bit 0 position. */
4924
#define ADC_CH_INTMODE1_bm (1<<3) /* Interrupt Mode bit 1 mask. */
4925
#define ADC_CH_INTMODE1_bp 3 /* Interrupt Mode bit 1 position. */
4927
#define ADC_CH_INTLVL_gm 0x03 /* Interrupt Level group mask. */
4928
#define ADC_CH_INTLVL_gp 0 /* Interrupt Level group position. */
4929
#define ADC_CH_INTLVL0_bm (1<<0) /* Interrupt Level bit 0 mask. */
4930
#define ADC_CH_INTLVL0_bp 0 /* Interrupt Level bit 0 position. */
4931
#define ADC_CH_INTLVL1_bm (1<<1) /* Interrupt Level bit 1 mask. */
4932
#define ADC_CH_INTLVL1_bp 1 /* Interrupt Level bit 1 position. */
4935
/* ADC_CH.INTFLAGS bit masks and bit positions */
4936
#define ADC_CH_CHIF_bm 0x01 /* Channel Interrupt Flag bit mask. */
4937
#define ADC_CH_CHIF_bp 0 /* Channel Interrupt Flag bit position. */
4940
/* ADC.CTRLA bit masks and bit positions */
4941
#define ADC_DMASEL_gm 0xC0 /* DMA Selection group mask. */
4942
#define ADC_DMASEL_gp 6 /* DMA Selection group position. */
4943
#define ADC_DMASEL0_bm (1<<6) /* DMA Selection bit 0 mask. */
4944
#define ADC_DMASEL0_bp 6 /* DMA Selection bit 0 position. */
4945
#define ADC_DMASEL1_bm (1<<7) /* DMA Selection bit 1 mask. */
4946
#define ADC_DMASEL1_bp 7 /* DMA Selection bit 1 position. */
4948
#define ADC_CH3START_bm 0x20 /* Channel 3 Start Conversion bit mask. */
4949
#define ADC_CH3START_bp 5 /* Channel 3 Start Conversion bit position. */
4951
#define ADC_CH2START_bm 0x10 /* Channel 2 Start Conversion bit mask. */
4952
#define ADC_CH2START_bp 4 /* Channel 2 Start Conversion bit position. */
4954
#define ADC_CH1START_bm 0x08 /* Channel 1 Start Conversion bit mask. */
4955
#define ADC_CH1START_bp 3 /* Channel 1 Start Conversion bit position. */
4957
#define ADC_CH0START_bm 0x04 /* Channel 0 Start Conversion bit mask. */
4958
#define ADC_CH0START_bp 2 /* Channel 0 Start Conversion bit position. */
4960
#define ADC_FLUSH_bm 0x02 /* Flush Pipeline bit mask. */
4961
#define ADC_FLUSH_bp 1 /* Flush Pipeline bit position. */
4963
#define ADC_ENABLE_bm 0x01 /* Enable ADC bit mask. */
4964
#define ADC_ENABLE_bp 0 /* Enable ADC bit position. */
4967
/* ADC.CTRLB bit masks and bit positions */
4968
#define ADC_CONMODE_bm 0x10 /* Conversion Mode bit mask. */
4969
#define ADC_CONMODE_bp 4 /* Conversion Mode bit position. */
4971
#define ADC_FREERUN_bm 0x08 /* Free Running Mode Enable bit mask. */
4972
#define ADC_FREERUN_bp 3 /* Free Running Mode Enable bit position. */
4974
#define ADC_RESOLUTION_gm 0x06 /* Result Resolution group mask. */
4975
#define ADC_RESOLUTION_gp 1 /* Result Resolution group position. */
4976
#define ADC_RESOLUTION0_bm (1<<1) /* Result Resolution bit 0 mask. */
4977
#define ADC_RESOLUTION0_bp 1 /* Result Resolution bit 0 position. */
4978
#define ADC_RESOLUTION1_bm (1<<2) /* Result Resolution bit 1 mask. */
4979
#define ADC_RESOLUTION1_bp 2 /* Result Resolution bit 1 position. */
4982
/* ADC.REFCTRL bit masks and bit positions */
4983
#define ADC_REFSEL_gm 0x30 /* Reference Selection group mask. */
4984
#define ADC_REFSEL_gp 4 /* Reference Selection group position. */
4985
#define ADC_REFSEL0_bm (1<<4) /* Reference Selection bit 0 mask. */
4986
#define ADC_REFSEL0_bp 4 /* Reference Selection bit 0 position. */
4987
#define ADC_REFSEL1_bm (1<<5) /* Reference Selection bit 1 mask. */
4988
#define ADC_REFSEL1_bp 5 /* Reference Selection bit 1 position. */
4990
#define ADC_BANDGAP_bm 0x02 /* Bandgap enable bit mask. */
4991
#define ADC_BANDGAP_bp 1 /* Bandgap enable bit position. */
4993
#define ADC_TEMPREF_bm 0x01 /* Temperature Reference Enable bit mask. */
4994
#define ADC_TEMPREF_bp 0 /* Temperature Reference Enable bit position. */
4997
/* ADC.EVCTRL bit masks and bit positions */
4998
#define ADC_SWEEP_gm 0xC0 /* Channel Sweep Selection group mask. */
4999
#define ADC_SWEEP_gp 6 /* Channel Sweep Selection group position. */
5000
#define ADC_SWEEP0_bm (1<<6) /* Channel Sweep Selection bit 0 mask. */
5001
#define ADC_SWEEP0_bp 6 /* Channel Sweep Selection bit 0 position. */
5002
#define ADC_SWEEP1_bm (1<<7) /* Channel Sweep Selection bit 1 mask. */
5003
#define ADC_SWEEP1_bp 7 /* Channel Sweep Selection bit 1 position. */
5005
#define ADC_EVSEL_gm 0x38 /* Event Input Select group mask. */
5006
#define ADC_EVSEL_gp 3 /* Event Input Select group position. */
5007
#define ADC_EVSEL0_bm (1<<3) /* Event Input Select bit 0 mask. */
5008
#define ADC_EVSEL0_bp 3 /* Event Input Select bit 0 position. */
5009
#define ADC_EVSEL1_bm (1<<4) /* Event Input Select bit 1 mask. */
5010
#define ADC_EVSEL1_bp 4 /* Event Input Select bit 1 position. */
5011
#define ADC_EVSEL2_bm (1<<5) /* Event Input Select bit 2 mask. */
5012
#define ADC_EVSEL2_bp 5 /* Event Input Select bit 2 position. */
5014
#define ADC_EVACT_gm 0x07 /* Event Action Select group mask. */
5015
#define ADC_EVACT_gp 0 /* Event Action Select group position. */
5016
#define ADC_EVACT0_bm (1<<0) /* Event Action Select bit 0 mask. */
5017
#define ADC_EVACT0_bp 0 /* Event Action Select bit 0 position. */
5018
#define ADC_EVACT1_bm (1<<1) /* Event Action Select bit 1 mask. */
5019
#define ADC_EVACT1_bp 1 /* Event Action Select bit 1 position. */
5020
#define ADC_EVACT2_bm (1<<2) /* Event Action Select bit 2 mask. */
5021
#define ADC_EVACT2_bp 2 /* Event Action Select bit 2 position. */
5024
/* ADC.PRESCALER bit masks and bit positions */
5025
#define ADC_PRESCALER_gm 0x07 /* Clock Prescaler Selection group mask. */
5026
#define ADC_PRESCALER_gp 0 /* Clock Prescaler Selection group position. */
5027
#define ADC_PRESCALER0_bm (1<<0) /* Clock Prescaler Selection bit 0 mask. */
5028
#define ADC_PRESCALER0_bp 0 /* Clock Prescaler Selection bit 0 position. */
5029
#define ADC_PRESCALER1_bm (1<<1) /* Clock Prescaler Selection bit 1 mask. */
5030
#define ADC_PRESCALER1_bp 1 /* Clock Prescaler Selection bit 1 position. */
5031
#define ADC_PRESCALER2_bm (1<<2) /* Clock Prescaler Selection bit 2 mask. */
5032
#define ADC_PRESCALER2_bp 2 /* Clock Prescaler Selection bit 2 position. */
5035
/* ADC.INTFLAGS bit masks and bit positions */
5036
#define ADC_CH3IF_bm 0x08 /* Channel 3 Interrupt Flag bit mask. */
5037
#define ADC_CH3IF_bp 3 /* Channel 3 Interrupt Flag bit position. */
5039
#define ADC_CH2IF_bm 0x04 /* Channel 2 Interrupt Flag bit mask. */
5040
#define ADC_CH2IF_bp 2 /* Channel 2 Interrupt Flag bit position. */
5042
#define ADC_CH1IF_bm 0x02 /* Channel 1 Interrupt Flag bit mask. */
5043
#define ADC_CH1IF_bp 1 /* Channel 1 Interrupt Flag bit position. */
5045
#define ADC_CH0IF_bm 0x01 /* Channel 0 Interrupt Flag bit mask. */
5046
#define ADC_CH0IF_bp 0 /* Channel 0 Interrupt Flag bit position. */
5049
/* DAC - Digital/Analog Converter */
5050
/* DAC.CTRLA bit masks and bit positions */
5051
#define DAC_IDOEN_bm 0x10 /* Internal Output Enable bit mask. */
5052
#define DAC_IDOEN_bp 4 /* Internal Output Enable bit position. */
5054
#define DAC_CH1EN_bm 0x08 /* Channel 1 Output Enable bit mask. */
5055
#define DAC_CH1EN_bp 3 /* Channel 1 Output Enable bit position. */
5057
#define DAC_CH0EN_bm 0x04 /* Channel 0 Output Enable bit mask. */
5058
#define DAC_CH0EN_bp 2 /* Channel 0 Output Enable bit position. */
5060
#define DAC_LPMODE_bm 0x02 /* Low Power Mode bit mask. */
5061
#define DAC_LPMODE_bp 1 /* Low Power Mode bit position. */
5063
#define DAC_ENABLE_bm 0x01 /* Enable bit mask. */
5064
#define DAC_ENABLE_bp 0 /* Enable bit position. */
5067
/* DAC.CTRLB bit masks and bit positions */
5068
#define DAC_CHSEL_gm 0x60 /* Channel Select group mask. */
5069
#define DAC_CHSEL_gp 5 /* Channel Select group position. */
5070
#define DAC_CHSEL0_bm (1<<5) /* Channel Select bit 0 mask. */
5071
#define DAC_CHSEL0_bp 5 /* Channel Select bit 0 position. */
5072
#define DAC_CHSEL1_bm (1<<6) /* Channel Select bit 1 mask. */
5073
#define DAC_CHSEL1_bp 6 /* Channel Select bit 1 position. */
5075
#define DAC_CH1TRIG_bm 0x02 /* Channel 1 Event Trig Enable bit mask. */
5076
#define DAC_CH1TRIG_bp 1 /* Channel 1 Event Trig Enable bit position. */
5078
#define DAC_CH0TRIG_bm 0x01 /* Channel 0 Event Trig Enable bit mask. */
5079
#define DAC_CH0TRIG_bp 0 /* Channel 0 Event Trig Enable bit position. */
5082
/* DAC.CTRLC bit masks and bit positions */
5083
#define DAC_REFSEL_gm 0x18 /* Reference Select group mask. */
5084
#define DAC_REFSEL_gp 3 /* Reference Select group position. */
5085
#define DAC_REFSEL0_bm (1<<3) /* Reference Select bit 0 mask. */
5086
#define DAC_REFSEL0_bp 3 /* Reference Select bit 0 position. */
5087
#define DAC_REFSEL1_bm (1<<4) /* Reference Select bit 1 mask. */
5088
#define DAC_REFSEL1_bp 4 /* Reference Select bit 1 position. */
5090
#define DAC_LEFTADJ_bm 0x01 /* Left-adjust Result bit mask. */
5091
#define DAC_LEFTADJ_bp 0 /* Left-adjust Result bit position. */
5094
/* DAC.EVCTRL bit masks and bit positions */
5095
#define DAC_EVSEL_gm 0x07 /* Event Input Selection group mask. */
5096
#define DAC_EVSEL_gp 0 /* Event Input Selection group position. */
5097
#define DAC_EVSEL0_bm (1<<0) /* Event Input Selection bit 0 mask. */
5098
#define DAC_EVSEL0_bp 0 /* Event Input Selection bit 0 position. */
5099
#define DAC_EVSEL1_bm (1<<1) /* Event Input Selection bit 1 mask. */
5100
#define DAC_EVSEL1_bp 1 /* Event Input Selection bit 1 position. */
5101
#define DAC_EVSEL2_bm (1<<2) /* Event Input Selection bit 2 mask. */
5102
#define DAC_EVSEL2_bp 2 /* Event Input Selection bit 2 position. */
5105
/* DAC.TIMCTRL bit masks and bit positions */
5106
#define DAC_CONINTVAL_gm 0x70 /* Conversion Intercal group mask. */
5107
#define DAC_CONINTVAL_gp 4 /* Conversion Intercal group position. */
5108
#define DAC_CONINTVAL0_bm (1<<4) /* Conversion Intercal bit 0 mask. */
5109
#define DAC_CONINTVAL0_bp 4 /* Conversion Intercal bit 0 position. */
5110
#define DAC_CONINTVAL1_bm (1<<5) /* Conversion Intercal bit 1 mask. */
5111
#define DAC_CONINTVAL1_bp 5 /* Conversion Intercal bit 1 position. */
5112
#define DAC_CONINTVAL2_bm (1<<6) /* Conversion Intercal bit 2 mask. */
5113
#define DAC_CONINTVAL2_bp 6 /* Conversion Intercal bit 2 position. */
5115
#define DAC_REFRESH_gm 0x0F /* Refresh Timing Control group mask. */
5116
#define DAC_REFRESH_gp 0 /* Refresh Timing Control group position. */
5117
#define DAC_REFRESH0_bm (1<<0) /* Refresh Timing Control bit 0 mask. */
5118
#define DAC_REFRESH0_bp 0 /* Refresh Timing Control bit 0 position. */
5119
#define DAC_REFRESH1_bm (1<<1) /* Refresh Timing Control bit 1 mask. */
5120
#define DAC_REFRESH1_bp 1 /* Refresh Timing Control bit 1 position. */
5121
#define DAC_REFRESH2_bm (1<<2) /* Refresh Timing Control bit 2 mask. */
5122
#define DAC_REFRESH2_bp 2 /* Refresh Timing Control bit 2 position. */
5123
#define DAC_REFRESH3_bm (1<<3) /* Refresh Timing Control bit 3 mask. */
5124
#define DAC_REFRESH3_bp 3 /* Refresh Timing Control bit 3 position. */
5127
/* DAC.STATUS bit masks and bit positions */
5128
#define DAC_CH1DRE_bm 0x02 /* Channel 1 Data Register Empty bit mask. */
5129
#define DAC_CH1DRE_bp 1 /* Channel 1 Data Register Empty bit position. */
5131
#define DAC_CH0DRE_bm 0x01 /* Channel 0 Data Register Empty bit mask. */
5132
#define DAC_CH0DRE_bp 0 /* Channel 0 Data Register Empty bit position. */
5135
/* RTC - Real-Time Clounter */
5136
/* RTC.CTRL bit masks and bit positions */
5137
#define RTC_PRESCALER_gm 0x07 /* Prescaling Factor group mask. */
5138
#define RTC_PRESCALER_gp 0 /* Prescaling Factor group position. */
5139
#define RTC_PRESCALER0_bm (1<<0) /* Prescaling Factor bit 0 mask. */
5140
#define RTC_PRESCALER0_bp 0 /* Prescaling Factor bit 0 position. */
5141
#define RTC_PRESCALER1_bm (1<<1) /* Prescaling Factor bit 1 mask. */
5142
#define RTC_PRESCALER1_bp 1 /* Prescaling Factor bit 1 position. */
5143
#define RTC_PRESCALER2_bm (1<<2) /* Prescaling Factor bit 2 mask. */
5144
#define RTC_PRESCALER2_bp 2 /* Prescaling Factor bit 2 position. */
5147
/* RTC.STATUS bit masks and bit positions */
5148
#define RTC_SYNCBUSY_bm 0x01 /* Synchronization Busy Flag bit mask. */
5149
#define RTC_SYNCBUSY_bp 0 /* Synchronization Busy Flag bit position. */
5152
/* RTC.INTCTRL bit masks and bit positions */
5153
#define RTC_COMPINTLVL_gm 0x0C /* Compare Match Interrupt Level group mask. */
5154
#define RTC_COMPINTLVL_gp 2 /* Compare Match Interrupt Level group position. */
5155
#define RTC_COMPINTLVL0_bm (1<<2) /* Compare Match Interrupt Level bit 0 mask. */
5156
#define RTC_COMPINTLVL0_bp 2 /* Compare Match Interrupt Level bit 0 position. */
5157
#define RTC_COMPINTLVL1_bm (1<<3) /* Compare Match Interrupt Level bit 1 mask. */
5158
#define RTC_COMPINTLVL1_bp 3 /* Compare Match Interrupt Level bit 1 position. */
5160
#define RTC_OVFINTLVL_gm 0x03 /* Overflow Interrupt Level group mask. */
5161
#define RTC_OVFINTLVL_gp 0 /* Overflow Interrupt Level group position. */
5162
#define RTC_OVFINTLVL0_bm (1<<0) /* Overflow Interrupt Level bit 0 mask. */
5163
#define RTC_OVFINTLVL0_bp 0 /* Overflow Interrupt Level bit 0 position. */
5164
#define RTC_OVFINTLVL1_bm (1<<1) /* Overflow Interrupt Level bit 1 mask. */
5165
#define RTC_OVFINTLVL1_bp 1 /* Overflow Interrupt Level bit 1 position. */
5168
/* RTC.INTFLAGS bit masks and bit positions */
5169
#define RTC_COMPIF_bm 0x02 /* Compare Match Interrupt Flag bit mask. */
5170
#define RTC_COMPIF_bp 1 /* Compare Match Interrupt Flag bit position. */
5172
#define RTC_OVFIF_bm 0x01 /* Overflow Interrupt Flag bit mask. */
5173
#define RTC_OVFIF_bp 0 /* Overflow Interrupt Flag bit position. */
5176
/* EBI - External Bus Interface */
5177
/* EBI_CS.CTRLA bit masks and bit positions */
5178
#define EBI_CS_ASIZE_gm 0x7C /* Address Size group mask. */
5179
#define EBI_CS_ASIZE_gp 2 /* Address Size group position. */
5180
#define EBI_CS_ASIZE0_bm (1<<2) /* Address Size bit 0 mask. */
5181
#define EBI_CS_ASIZE0_bp 2 /* Address Size bit 0 position. */
5182
#define EBI_CS_ASIZE1_bm (1<<3) /* Address Size bit 1 mask. */
5183
#define EBI_CS_ASIZE1_bp 3 /* Address Size bit 1 position. */
5184
#define EBI_CS_ASIZE2_bm (1<<4) /* Address Size bit 2 mask. */
5185
#define EBI_CS_ASIZE2_bp 4 /* Address Size bit 2 position. */
5186
#define EBI_CS_ASIZE3_bm (1<<5) /* Address Size bit 3 mask. */
5187
#define EBI_CS_ASIZE3_bp 5 /* Address Size bit 3 position. */
5188
#define EBI_CS_ASIZE4_bm (1<<6) /* Address Size bit 4 mask. */
5189
#define EBI_CS_ASIZE4_bp 6 /* Address Size bit 4 position. */
5191
#define EBI_CS_MODE_gm 0x03 /* Memory Mode group mask. */
5192
#define EBI_CS_MODE_gp 0 /* Memory Mode group position. */
5193
#define EBI_CS_MODE0_bm (1<<0) /* Memory Mode bit 0 mask. */
5194
#define EBI_CS_MODE0_bp 0 /* Memory Mode bit 0 position. */
5195
#define EBI_CS_MODE1_bm (1<<1) /* Memory Mode bit 1 mask. */
5196
#define EBI_CS_MODE1_bp 1 /* Memory Mode bit 1 position. */
5199
/* EBI_CS.CTRLB bit masks and bit positions */
5200
#define EBI_CS_SRWS_gm 0x07 /* SRAM Wait State Cycles group mask. */
5201
#define EBI_CS_SRWS_gp 0 /* SRAM Wait State Cycles group position. */
5202
#define EBI_CS_SRWS0_bm (1<<0) /* SRAM Wait State Cycles bit 0 mask. */
5203
#define EBI_CS_SRWS0_bp 0 /* SRAM Wait State Cycles bit 0 position. */
5204
#define EBI_CS_SRWS1_bm (1<<1) /* SRAM Wait State Cycles bit 1 mask. */
5205
#define EBI_CS_SRWS1_bp 1 /* SRAM Wait State Cycles bit 1 position. */
5206
#define EBI_CS_SRWS2_bm (1<<2) /* SRAM Wait State Cycles bit 2 mask. */
5207
#define EBI_CS_SRWS2_bp 2 /* SRAM Wait State Cycles bit 2 position. */
5209
#define EBI_CS_SDINITDONE_bm 0x80 /* SDRAM Initialization Done bit mask. */
5210
#define EBI_CS_SDINITDONE_bp 7 /* SDRAM Initialization Done bit position. */
5212
#define EBI_CS_SDSREN_bm 0x04 /* SDRAM Self-refresh Enable bit mask. */
5213
#define EBI_CS_SDSREN_bp 2 /* SDRAM Self-refresh Enable bit position. */
5215
#define EBI_CS_SDMODE_gm 0x03 /* SDRAM Mode group mask. */
5216
#define EBI_CS_SDMODE_gp 0 /* SDRAM Mode group position. */
5217
#define EBI_CS_SDMODE0_bm (1<<0) /* SDRAM Mode bit 0 mask. */
5218
#define EBI_CS_SDMODE0_bp 0 /* SDRAM Mode bit 0 position. */
5219
#define EBI_CS_SDMODE1_bm (1<<1) /* SDRAM Mode bit 1 mask. */
5220
#define EBI_CS_SDMODE1_bp 1 /* SDRAM Mode bit 1 position. */
5223
/* EBI.CTRL bit masks and bit positions */
5224
#define EBI_SDDATAW_gm 0xC0 /* SDRAM Data Width Setting group mask. */
5225
#define EBI_SDDATAW_gp 6 /* SDRAM Data Width Setting group position. */
5226
#define EBI_SDDATAW0_bm (1<<6) /* SDRAM Data Width Setting bit 0 mask. */
5227
#define EBI_SDDATAW0_bp 6 /* SDRAM Data Width Setting bit 0 position. */
5228
#define EBI_SDDATAW1_bm (1<<7) /* SDRAM Data Width Setting bit 1 mask. */
5229
#define EBI_SDDATAW1_bp 7 /* SDRAM Data Width Setting bit 1 position. */
5231
#define EBI_LPCMODE_gm 0x30 /* SRAM LPC Mode group mask. */
5232
#define EBI_LPCMODE_gp 4 /* SRAM LPC Mode group position. */
5233
#define EBI_LPCMODE0_bm (1<<4) /* SRAM LPC Mode bit 0 mask. */
5234
#define EBI_LPCMODE0_bp 4 /* SRAM LPC Mode bit 0 position. */
5235
#define EBI_LPCMODE1_bm (1<<5) /* SRAM LPC Mode bit 1 mask. */
5236
#define EBI_LPCMODE1_bp 5 /* SRAM LPC Mode bit 1 position. */
5238
#define EBI_SRMODE_gm 0x0C /* SRAM Mode group mask. */
5239
#define EBI_SRMODE_gp 2 /* SRAM Mode group position. */
5240
#define EBI_SRMODE0_bm (1<<2) /* SRAM Mode bit 0 mask. */
5241
#define EBI_SRMODE0_bp 2 /* SRAM Mode bit 0 position. */
5242
#define EBI_SRMODE1_bm (1<<3) /* SRAM Mode bit 1 mask. */
5243
#define EBI_SRMODE1_bp 3 /* SRAM Mode bit 1 position. */
5245
#define EBI_IFMODE_gm 0x03 /* Interface Mode group mask. */
5246
#define EBI_IFMODE_gp 0 /* Interface Mode group position. */
5247
#define EBI_IFMODE0_bm (1<<0) /* Interface Mode bit 0 mask. */
5248
#define EBI_IFMODE0_bp 0 /* Interface Mode bit 0 position. */
5249
#define EBI_IFMODE1_bm (1<<1) /* Interface Mode bit 1 mask. */
5250
#define EBI_IFMODE1_bp 1 /* Interface Mode bit 1 position. */
5253
/* EBI.SDRAMCTRLA bit masks and bit positions */
5254
#define EBI_SDCAS_bm 0x08 /* SDRAM CAS Latency Setting bit mask. */
5255
#define EBI_SDCAS_bp 3 /* SDRAM CAS Latency Setting bit position. */
5257
#define EBI_SDROW_bm 0x04 /* SDRAM ROW Bits Setting bit mask. */
5258
#define EBI_SDROW_bp 2 /* SDRAM ROW Bits Setting bit position. */
5260
#define EBI_SDCOL_gm 0x03 /* SDRAM Column Bits Setting group mask. */
5261
#define EBI_SDCOL_gp 0 /* SDRAM Column Bits Setting group position. */
5262
#define EBI_SDCOL0_bm (1<<0) /* SDRAM Column Bits Setting bit 0 mask. */
5263
#define EBI_SDCOL0_bp 0 /* SDRAM Column Bits Setting bit 0 position. */
5264
#define EBI_SDCOL1_bm (1<<1) /* SDRAM Column Bits Setting bit 1 mask. */
5265
#define EBI_SDCOL1_bp 1 /* SDRAM Column Bits Setting bit 1 position. */
5268
/* EBI.SDRAMCTRLB bit masks and bit positions */
5269
#define EBI_MRDLY_gm 0xC0 /* SDRAM Mode Register Delay group mask. */
5270
#define EBI_MRDLY_gp 6 /* SDRAM Mode Register Delay group position. */
5271
#define EBI_MRDLY0_bm (1<<6) /* SDRAM Mode Register Delay bit 0 mask. */
5272
#define EBI_MRDLY0_bp 6 /* SDRAM Mode Register Delay bit 0 position. */
5273
#define EBI_MRDLY1_bm (1<<7) /* SDRAM Mode Register Delay bit 1 mask. */
5274
#define EBI_MRDLY1_bp 7 /* SDRAM Mode Register Delay bit 1 position. */
5276
#define EBI_ROWCYCDLY_gm 0x38 /* SDRAM Row Cycle Delay group mask. */
5277
#define EBI_ROWCYCDLY_gp 3 /* SDRAM Row Cycle Delay group position. */
5278
#define EBI_ROWCYCDLY0_bm (1<<3) /* SDRAM Row Cycle Delay bit 0 mask. */
5279
#define EBI_ROWCYCDLY0_bp 3 /* SDRAM Row Cycle Delay bit 0 position. */
5280
#define EBI_ROWCYCDLY1_bm (1<<4) /* SDRAM Row Cycle Delay bit 1 mask. */
5281
#define EBI_ROWCYCDLY1_bp 4 /* SDRAM Row Cycle Delay bit 1 position. */
5282
#define EBI_ROWCYCDLY2_bm (1<<5) /* SDRAM Row Cycle Delay bit 2 mask. */
5283
#define EBI_ROWCYCDLY2_bp 5 /* SDRAM Row Cycle Delay bit 2 position. */
5285
#define EBI_RPDLY_gm 0x07 /* SDRAM Row-to-Precharge Delay group mask. */
5286
#define EBI_RPDLY_gp 0 /* SDRAM Row-to-Precharge Delay group position. */
5287
#define EBI_RPDLY0_bm (1<<0) /* SDRAM Row-to-Precharge Delay bit 0 mask. */
5288
#define EBI_RPDLY0_bp 0 /* SDRAM Row-to-Precharge Delay bit 0 position. */
5289
#define EBI_RPDLY1_bm (1<<1) /* SDRAM Row-to-Precharge Delay bit 1 mask. */
5290
#define EBI_RPDLY1_bp 1 /* SDRAM Row-to-Precharge Delay bit 1 position. */
5291
#define EBI_RPDLY2_bm (1<<2) /* SDRAM Row-to-Precharge Delay bit 2 mask. */
5292
#define EBI_RPDLY2_bp 2 /* SDRAM Row-to-Precharge Delay bit 2 position. */
5295
/* EBI.SDRAMCTRLC bit masks and bit positions */
5296
#define EBI_WRDLY_gm 0xC0 /* SDRAM Write Recovery Delay group mask. */
5297
#define EBI_WRDLY_gp 6 /* SDRAM Write Recovery Delay group position. */
5298
#define EBI_WRDLY0_bm (1<<6) /* SDRAM Write Recovery Delay bit 0 mask. */
5299
#define EBI_WRDLY0_bp 6 /* SDRAM Write Recovery Delay bit 0 position. */
5300
#define EBI_WRDLY1_bm (1<<7) /* SDRAM Write Recovery Delay bit 1 mask. */
5301
#define EBI_WRDLY1_bp 7 /* SDRAM Write Recovery Delay bit 1 position. */
5303
#define EBI_ESRDLY_gm 0x38 /* SDRAM Exit-Self-refresh-to-Active Delay group mask. */
5304
#define EBI_ESRDLY_gp 3 /* SDRAM Exit-Self-refresh-to-Active Delay group position. */
5305
#define EBI_ESRDLY0_bm (1<<3) /* SDRAM Exit-Self-refresh-to-Active Delay bit 0 mask. */
5306
#define EBI_ESRDLY0_bp 3 /* SDRAM Exit-Self-refresh-to-Active Delay bit 0 position. */
5307
#define EBI_ESRDLY1_bm (1<<4) /* SDRAM Exit-Self-refresh-to-Active Delay bit 1 mask. */
5308
#define EBI_ESRDLY1_bp 4 /* SDRAM Exit-Self-refresh-to-Active Delay bit 1 position. */
5309
#define EBI_ESRDLY2_bm (1<<5) /* SDRAM Exit-Self-refresh-to-Active Delay bit 2 mask. */
5310
#define EBI_ESRDLY2_bp 5 /* SDRAM Exit-Self-refresh-to-Active Delay bit 2 position. */
5312
#define EBI_ROWCOLDLY_gm 0x07 /* SDRAM Row-to-Column Delay group mask. */
5313
#define EBI_ROWCOLDLY_gp 0 /* SDRAM Row-to-Column Delay group position. */
5314
#define EBI_ROWCOLDLY0_bm (1<<0) /* SDRAM Row-to-Column Delay bit 0 mask. */
5315
#define EBI_ROWCOLDLY0_bp 0 /* SDRAM Row-to-Column Delay bit 0 position. */
5316
#define EBI_ROWCOLDLY1_bm (1<<1) /* SDRAM Row-to-Column Delay bit 1 mask. */
5317
#define EBI_ROWCOLDLY1_bp 1 /* SDRAM Row-to-Column Delay bit 1 position. */
5318
#define EBI_ROWCOLDLY2_bm (1<<2) /* SDRAM Row-to-Column Delay bit 2 mask. */
5319
#define EBI_ROWCOLDLY2_bp 2 /* SDRAM Row-to-Column Delay bit 2 position. */
5322
/* TWI - Two-Wire Interface */
5323
/* TWI_MASTER.CTRLA bit masks and bit positions */
5324
#define TWI_MASTER_INTLVL_gm 0xC0 /* Interrupt Level group mask. */
5325
#define TWI_MASTER_INTLVL_gp 6 /* Interrupt Level group position. */
5326
#define TWI_MASTER_INTLVL0_bm (1<<6) /* Interrupt Level bit 0 mask. */
5327
#define TWI_MASTER_INTLVL0_bp 6 /* Interrupt Level bit 0 position. */
5328
#define TWI_MASTER_INTLVL1_bm (1<<7) /* Interrupt Level bit 1 mask. */
5329
#define TWI_MASTER_INTLVL1_bp 7 /* Interrupt Level bit 1 position. */
5331
#define TWI_MASTER_RIEN_bm 0x20 /* Read Interrupt Enable bit mask. */
5332
#define TWI_MASTER_RIEN_bp 5 /* Read Interrupt Enable bit position. */
5334
#define TWI_MASTER_WIEN_bm 0x10 /* Write Interrupt Enable bit mask. */
5335
#define TWI_MASTER_WIEN_bp 4 /* Write Interrupt Enable bit position. */
5337
#define TWI_MASTER_ENABLE_bm 0x08 /* Enable TWI Master bit mask. */
5338
#define TWI_MASTER_ENABLE_bp 3 /* Enable TWI Master bit position. */
5341
/* TWI_MASTER.CTRLB bit masks and bit positions */
5342
#define TWI_MASTER_TIMEOUT_gm 0x0C /* Inactive Bus Timeout group mask. */
5343
#define TWI_MASTER_TIMEOUT_gp 2 /* Inactive Bus Timeout group position. */
5344
#define TWI_MASTER_TIMEOUT0_bm (1<<2) /* Inactive Bus Timeout bit 0 mask. */
5345
#define TWI_MASTER_TIMEOUT0_bp 2 /* Inactive Bus Timeout bit 0 position. */
5346
#define TWI_MASTER_TIMEOUT1_bm (1<<3) /* Inactive Bus Timeout bit 1 mask. */
5347
#define TWI_MASTER_TIMEOUT1_bp 3 /* Inactive Bus Timeout bit 1 position. */
5349
#define TWI_MASTER_QCEN_bm 0x02 /* Quick Command Enable bit mask. */
5350
#define TWI_MASTER_QCEN_bp 1 /* Quick Command Enable bit position. */
5352
#define TWI_MASTER_SMEN_bm 0x01 /* Smart Mode Enable bit mask. */
5353
#define TWI_MASTER_SMEN_bp 0 /* Smart Mode Enable bit position. */
5356
/* TWI_MASTER.CTRLC bit masks and bit positions */
5357
#define TWI_MASTER_ACKACT_bm 0x04 /* Acknowledge Action bit mask. */
5358
#define TWI_MASTER_ACKACT_bp 2 /* Acknowledge Action bit position. */
5360
#define TWI_MASTER_CMD_gm 0x03 /* Command group mask. */
5361
#define TWI_MASTER_CMD_gp 0 /* Command group position. */
5362
#define TWI_MASTER_CMD0_bm (1<<0) /* Command bit 0 mask. */
5363
#define TWI_MASTER_CMD0_bp 0 /* Command bit 0 position. */
5364
#define TWI_MASTER_CMD1_bm (1<<1) /* Command bit 1 mask. */
5365
#define TWI_MASTER_CMD1_bp 1 /* Command bit 1 position. */
5368
/* TWI_MASTER.STATUS bit masks and bit positions */
5369
#define TWI_MASTER_RIF_bm 0x80 /* Read Interrupt Flag bit mask. */
5370
#define TWI_MASTER_RIF_bp 7 /* Read Interrupt Flag bit position. */
5372
#define TWI_MASTER_WIF_bm 0x40 /* Write Interrupt Flag bit mask. */
5373
#define TWI_MASTER_WIF_bp 6 /* Write Interrupt Flag bit position. */
5375
#define TWI_MASTER_CLKHOLD_bm 0x20 /* Clock Hold bit mask. */
5376
#define TWI_MASTER_CLKHOLD_bp 5 /* Clock Hold bit position. */
5378
#define TWI_MASTER_RXACK_bm 0x10 /* Received Acknowledge bit mask. */
5379
#define TWI_MASTER_RXACK_bp 4 /* Received Acknowledge bit position. */
5381
#define TWI_MASTER_ARBLOST_bm 0x08 /* Arbitration Lost bit mask. */
5382
#define TWI_MASTER_ARBLOST_bp 3 /* Arbitration Lost bit position. */
5384
#define TWI_MASTER_BUSERR_bm 0x04 /* Bus Error bit mask. */
5385
#define TWI_MASTER_BUSERR_bp 2 /* Bus Error bit position. */
5387
#define TWI_MASTER_BUSSTATE_gm 0x03 /* Bus State group mask. */
5388
#define TWI_MASTER_BUSSTATE_gp 0 /* Bus State group position. */
5389
#define TWI_MASTER_BUSSTATE0_bm (1<<0) /* Bus State bit 0 mask. */
5390
#define TWI_MASTER_BUSSTATE0_bp 0 /* Bus State bit 0 position. */
5391
#define TWI_MASTER_BUSSTATE1_bm (1<<1) /* Bus State bit 1 mask. */
5392
#define TWI_MASTER_BUSSTATE1_bp 1 /* Bus State bit 1 position. */
5395
/* TWI_SLAVE.CTRLA bit masks and bit positions */
5396
#define TWI_SLAVE_INTLVL_gm 0xC0 /* Interrupt Level group mask. */
5397
#define TWI_SLAVE_INTLVL_gp 6 /* Interrupt Level group position. */
5398
#define TWI_SLAVE_INTLVL0_bm (1<<6) /* Interrupt Level bit 0 mask. */
5399
#define TWI_SLAVE_INTLVL0_bp 6 /* Interrupt Level bit 0 position. */
5400
#define TWI_SLAVE_INTLVL1_bm (1<<7) /* Interrupt Level bit 1 mask. */
5401
#define TWI_SLAVE_INTLVL1_bp 7 /* Interrupt Level bit 1 position. */
5403
#define TWI_SLAVE_DIEN_bm 0x20 /* Data Interrupt Enable bit mask. */
5404
#define TWI_SLAVE_DIEN_bp 5 /* Data Interrupt Enable bit position. */
5406
#define TWI_SLAVE_APIEN_bm 0x10 /* Address/Stop Interrupt Enable bit mask. */
5407
#define TWI_SLAVE_APIEN_bp 4 /* Address/Stop Interrupt Enable bit position. */
5409
#define TWI_SLAVE_ENABLE_bm 0x08 /* Enable TWI Slave bit mask. */
5410
#define TWI_SLAVE_ENABLE_bp 3 /* Enable TWI Slave bit position. */
5412
#define TWI_SLAVE_PIEN_bm 0x04 /* Stop Interrupt Enable bit mask. */
5413
#define TWI_SLAVE_PIEN_bp 2 /* Stop Interrupt Enable bit position. */
5415
#define TWI_SLAVE_PMEN_bm 0x02 /* Promiscuous Mode Enable bit mask. */
5416
#define TWI_SLAVE_PMEN_bp 1 /* Promiscuous Mode Enable bit position. */
5418
#define TWI_SLAVE_SMEN_bm 0x01 /* Smart Mode Enable bit mask. */
5419
#define TWI_SLAVE_SMEN_bp 0 /* Smart Mode Enable bit position. */
5422
/* TWI_SLAVE.CTRLB bit masks and bit positions */
5423
#define TWI_SLAVE_ACKACT_bm 0x04 /* Acknowledge Action bit mask. */
5424
#define TWI_SLAVE_ACKACT_bp 2 /* Acknowledge Action bit position. */
5426
#define TWI_SLAVE_CMD_gm 0x03 /* Command group mask. */
5427
#define TWI_SLAVE_CMD_gp 0 /* Command group position. */
5428
#define TWI_SLAVE_CMD0_bm (1<<0) /* Command bit 0 mask. */
5429
#define TWI_SLAVE_CMD0_bp 0 /* Command bit 0 position. */
5430
#define TWI_SLAVE_CMD1_bm (1<<1) /* Command bit 1 mask. */
5431
#define TWI_SLAVE_CMD1_bp 1 /* Command bit 1 position. */
5434
/* TWI_SLAVE.STATUS bit masks and bit positions */
5435
#define TWI_SLAVE_DIF_bm 0x80 /* Data Interrupt Flag bit mask. */
5436
#define TWI_SLAVE_DIF_bp 7 /* Data Interrupt Flag bit position. */
5438
#define TWI_SLAVE_APIF_bm 0x40 /* Address/Stop Interrupt Flag bit mask. */
5439
#define TWI_SLAVE_APIF_bp 6 /* Address/Stop Interrupt Flag bit position. */
5441
#define TWI_SLAVE_CLKHOLD_bm 0x20 /* Clock Hold bit mask. */
5442
#define TWI_SLAVE_CLKHOLD_bp 5 /* Clock Hold bit position. */
5444
#define TWI_SLAVE_RXACK_bm 0x10 /* Received Acknowledge bit mask. */
5445
#define TWI_SLAVE_RXACK_bp 4 /* Received Acknowledge bit position. */
5447
#define TWI_SLAVE_COLL_bm 0x08 /* Collision bit mask. */
5448
#define TWI_SLAVE_COLL_bp 3 /* Collision bit position. */
5450
#define TWI_SLAVE_BUSERR_bm 0x04 /* Bus Error bit mask. */
5451
#define TWI_SLAVE_BUSERR_bp 2 /* Bus Error bit position. */
5453
#define TWI_SLAVE_DIR_bm 0x02 /* Read/Write Direction bit mask. */
5454
#define TWI_SLAVE_DIR_bp 1 /* Read/Write Direction bit position. */
5456
#define TWI_SLAVE_AP_bm 0x01 /* Slave Address or Stop bit mask. */
5457
#define TWI_SLAVE_AP_bp 0 /* Slave Address or Stop bit position. */
5460
/* TWI_SLAVE.ADDRMASK bit masks and bit positions */
5461
#define TWI_SLAVE_ADDRMASK_gm 0xFE /* Address Mask group mask. */
5462
#define TWI_SLAVE_ADDRMASK_gp 1 /* Address Mask group position. */
5463
#define TWI_SLAVE_ADDRMASK0_bm (1<<1) /* Address Mask bit 0 mask. */
5464
#define TWI_SLAVE_ADDRMASK0_bp 1 /* Address Mask bit 0 position. */
5465
#define TWI_SLAVE_ADDRMASK1_bm (1<<2) /* Address Mask bit 1 mask. */
5466
#define TWI_SLAVE_ADDRMASK1_bp 2 /* Address Mask bit 1 position. */
5467
#define TWI_SLAVE_ADDRMASK2_bm (1<<3) /* Address Mask bit 2 mask. */
5468
#define TWI_SLAVE_ADDRMASK2_bp 3 /* Address Mask bit 2 position. */
5469
#define TWI_SLAVE_ADDRMASK3_bm (1<<4) /* Address Mask bit 3 mask. */
5470
#define TWI_SLAVE_ADDRMASK3_bp 4 /* Address Mask bit 3 position. */
5471
#define TWI_SLAVE_ADDRMASK4_bm (1<<5) /* Address Mask bit 4 mask. */
5472
#define TWI_SLAVE_ADDRMASK4_bp 5 /* Address Mask bit 4 position. */
5473
#define TWI_SLAVE_ADDRMASK5_bm (1<<6) /* Address Mask bit 5 mask. */
5474
#define TWI_SLAVE_ADDRMASK5_bp 6 /* Address Mask bit 5 position. */
5475
#define TWI_SLAVE_ADDRMASK6_bm (1<<7) /* Address Mask bit 6 mask. */
5476
#define TWI_SLAVE_ADDRMASK6_bp 7 /* Address Mask bit 6 position. */
5478
#define TWI_SLAVE_ADDREN_bm 0x01 /* Address Enable bit mask. */
5479
#define TWI_SLAVE_ADDREN_bp 0 /* Address Enable bit position. */
5482
/* TWI.CTRL bit masks and bit positions */
5483
#define TWI_SDAHOLD_bm 0x02 /* SDA Hold Time Enable bit mask. */
5484
#define TWI_SDAHOLD_bp 1 /* SDA Hold Time Enable bit position. */
5486
#define TWI_EDIEN_bm 0x01 /* External Driver Interface Enable bit mask. */
5487
#define TWI_EDIEN_bp 0 /* External Driver Interface Enable bit position. */
5490
/* PORT - Port Configuration */
5491
/* PORTCFG.VPCTRLA bit masks and bit positions */
5492
#define PORTCFG_VP1MAP_gm 0xF0 /* Virtual Port 1 Mapping group mask. */
5493
#define PORTCFG_VP1MAP_gp 4 /* Virtual Port 1 Mapping group position. */
5494
#define PORTCFG_VP1MAP0_bm (1<<4) /* Virtual Port 1 Mapping bit 0 mask. */
5495
#define PORTCFG_VP1MAP0_bp 4 /* Virtual Port 1 Mapping bit 0 position. */
5496
#define PORTCFG_VP1MAP1_bm (1<<5) /* Virtual Port 1 Mapping bit 1 mask. */
5497
#define PORTCFG_VP1MAP1_bp 5 /* Virtual Port 1 Mapping bit 1 position. */
5498
#define PORTCFG_VP1MAP2_bm (1<<6) /* Virtual Port 1 Mapping bit 2 mask. */
5499
#define PORTCFG_VP1MAP2_bp 6 /* Virtual Port 1 Mapping bit 2 position. */
5500
#define PORTCFG_VP1MAP3_bm (1<<7) /* Virtual Port 1 Mapping bit 3 mask. */
5501
#define PORTCFG_VP1MAP3_bp 7 /* Virtual Port 1 Mapping bit 3 position. */
5503
#define PORTCFG_VP0MAP_gm 0x0F /* Virtual Port 0 Mapping group mask. */
5504
#define PORTCFG_VP0MAP_gp 0 /* Virtual Port 0 Mapping group position. */
5505
#define PORTCFG_VP0MAP0_bm (1<<0) /* Virtual Port 0 Mapping bit 0 mask. */
5506
#define PORTCFG_VP0MAP0_bp 0 /* Virtual Port 0 Mapping bit 0 position. */
5507
#define PORTCFG_VP0MAP1_bm (1<<1) /* Virtual Port 0 Mapping bit 1 mask. */
5508
#define PORTCFG_VP0MAP1_bp 1 /* Virtual Port 0 Mapping bit 1 position. */
5509
#define PORTCFG_VP0MAP2_bm (1<<2) /* Virtual Port 0 Mapping bit 2 mask. */
5510
#define PORTCFG_VP0MAP2_bp 2 /* Virtual Port 0 Mapping bit 2 position. */
5511
#define PORTCFG_VP0MAP3_bm (1<<3) /* Virtual Port 0 Mapping bit 3 mask. */
5512
#define PORTCFG_VP0MAP3_bp 3 /* Virtual Port 0 Mapping bit 3 position. */
5515
/* PORTCFG.VPCTRLB bit masks and bit positions */
5516
#define PORTCFG_VP3MAP_gm 0xF0 /* Virtual Port 3 Mapping group mask. */
5517
#define PORTCFG_VP3MAP_gp 4 /* Virtual Port 3 Mapping group position. */
5518
#define PORTCFG_VP3MAP0_bm (1<<4) /* Virtual Port 3 Mapping bit 0 mask. */
5519
#define PORTCFG_VP3MAP0_bp 4 /* Virtual Port 3 Mapping bit 0 position. */
5520
#define PORTCFG_VP3MAP1_bm (1<<5) /* Virtual Port 3 Mapping bit 1 mask. */
5521
#define PORTCFG_VP3MAP1_bp 5 /* Virtual Port 3 Mapping bit 1 position. */
5522
#define PORTCFG_VP3MAP2_bm (1<<6) /* Virtual Port 3 Mapping bit 2 mask. */
5523
#define PORTCFG_VP3MAP2_bp 6 /* Virtual Port 3 Mapping bit 2 position. */
5524
#define PORTCFG_VP3MAP3_bm (1<<7) /* Virtual Port 3 Mapping bit 3 mask. */
5525
#define PORTCFG_VP3MAP3_bp 7 /* Virtual Port 3 Mapping bit 3 position. */
5527
#define PORTCFG_VP2MAP_gm 0x0F /* Virtual Port 2 Mapping group mask. */
5528
#define PORTCFG_VP2MAP_gp 0 /* Virtual Port 2 Mapping group position. */
5529
#define PORTCFG_VP2MAP0_bm (1<<0) /* Virtual Port 2 Mapping bit 0 mask. */
5530
#define PORTCFG_VP2MAP0_bp 0 /* Virtual Port 2 Mapping bit 0 position. */
5531
#define PORTCFG_VP2MAP1_bm (1<<1) /* Virtual Port 2 Mapping bit 1 mask. */
5532
#define PORTCFG_VP2MAP1_bp 1 /* Virtual Port 2 Mapping bit 1 position. */
5533
#define PORTCFG_VP2MAP2_bm (1<<2) /* Virtual Port 2 Mapping bit 2 mask. */
5534
#define PORTCFG_VP2MAP2_bp 2 /* Virtual Port 2 Mapping bit 2 position. */
5535
#define PORTCFG_VP2MAP3_bm (1<<3) /* Virtual Port 2 Mapping bit 3 mask. */
5536
#define PORTCFG_VP2MAP3_bp 3 /* Virtual Port 2 Mapping bit 3 position. */
5539
/* PORTCFG.CLKEVOUT bit masks and bit positions */
5540
#define PORTCFG_CLKOUT_gm 0x03 /* Clock Output Port group mask. */
5541
#define PORTCFG_CLKOUT_gp 0 /* Clock Output Port group position. */
5542
#define PORTCFG_CLKOUT0_bm (1<<0) /* Clock Output Port bit 0 mask. */
5543
#define PORTCFG_CLKOUT0_bp 0 /* Clock Output Port bit 0 position. */
5544
#define PORTCFG_CLKOUT1_bm (1<<1) /* Clock Output Port bit 1 mask. */
5545
#define PORTCFG_CLKOUT1_bp 1 /* Clock Output Port bit 1 position. */
5547
#define PORTCFG_EVOUT_gm 0x30 /* Event Output Port group mask. */
5548
#define PORTCFG_EVOUT_gp 4 /* Event Output Port group position. */
5549
#define PORTCFG_EVOUT0_bm (1<<4) /* Event Output Port bit 0 mask. */
5550
#define PORTCFG_EVOUT0_bp 4 /* Event Output Port bit 0 position. */
5551
#define PORTCFG_EVOUT1_bm (1<<5) /* Event Output Port bit 1 mask. */
5552
#define PORTCFG_EVOUT1_bp 5 /* Event Output Port bit 1 position. */
5555
/* VPORT.INTFLAGS bit masks and bit positions */
5556
#define VPORT_INT1IF_bm 0x02 /* Port Interrupt 1 Flag bit mask. */
5557
#define VPORT_INT1IF_bp 1 /* Port Interrupt 1 Flag bit position. */
5559
#define VPORT_INT0IF_bm 0x01 /* Port Interrupt 0 Flag bit mask. */
5560
#define VPORT_INT0IF_bp 0 /* Port Interrupt 0 Flag bit position. */
5563
/* PORT.INTCTRL bit masks and bit positions */
5564
#define PORT_INT1LVL_gm 0x0C /* Port Interrupt 1 Level group mask. */
5565
#define PORT_INT1LVL_gp 2 /* Port Interrupt 1 Level group position. */
5566
#define PORT_INT1LVL0_bm (1<<2) /* Port Interrupt 1 Level bit 0 mask. */
5567
#define PORT_INT1LVL0_bp 2 /* Port Interrupt 1 Level bit 0 position. */
5568
#define PORT_INT1LVL1_bm (1<<3) /* Port Interrupt 1 Level bit 1 mask. */
5569
#define PORT_INT1LVL1_bp 3 /* Port Interrupt 1 Level bit 1 position. */
5571
#define PORT_INT0LVL_gm 0x03 /* Port Interrupt 0 Level group mask. */
5572
#define PORT_INT0LVL_gp 0 /* Port Interrupt 0 Level group position. */
5573
#define PORT_INT0LVL0_bm (1<<0) /* Port Interrupt 0 Level bit 0 mask. */
5574
#define PORT_INT0LVL0_bp 0 /* Port Interrupt 0 Level bit 0 position. */
5575
#define PORT_INT0LVL1_bm (1<<1) /* Port Interrupt 0 Level bit 1 mask. */
5576
#define PORT_INT0LVL1_bp 1 /* Port Interrupt 0 Level bit 1 position. */
5579
/* PORT.INTFLAGS bit masks and bit positions */
5580
#define PORT_INT1IF_bm 0x02 /* Port Interrupt 1 Flag bit mask. */
5581
#define PORT_INT1IF_bp 1 /* Port Interrupt 1 Flag bit position. */
5583
#define PORT_INT0IF_bm 0x01 /* Port Interrupt 0 Flag bit mask. */
5584
#define PORT_INT0IF_bp 0 /* Port Interrupt 0 Flag bit position. */
5587
/* PORT.PIN0CTRL bit masks and bit positions */
5588
#define PORT_SRLEN_bm 0x80 /* Slew Rate Enable bit mask. */
5589
#define PORT_SRLEN_bp 7 /* Slew Rate Enable bit position. */
5591
#define PORT_INVEN_bm 0x40 /* Inverted I/O Enable bit mask. */
5592
#define PORT_INVEN_bp 6 /* Inverted I/O Enable bit position. */
5594
#define PORT_OPC_gm 0x38 /* Output/Pull Configuration group mask. */
5595
#define PORT_OPC_gp 3 /* Output/Pull Configuration group position. */
5596
#define PORT_OPC0_bm (1<<3) /* Output/Pull Configuration bit 0 mask. */
5597
#define PORT_OPC0_bp 3 /* Output/Pull Configuration bit 0 position. */
5598
#define PORT_OPC1_bm (1<<4) /* Output/Pull Configuration bit 1 mask. */
5599
#define PORT_OPC1_bp 4 /* Output/Pull Configuration bit 1 position. */
5600
#define PORT_OPC2_bm (1<<5) /* Output/Pull Configuration bit 2 mask. */
5601
#define PORT_OPC2_bp 5 /* Output/Pull Configuration bit 2 position. */
5603
#define PORT_ISC_gm 0x07 /* Input/Sense Configuration group mask. */
5604
#define PORT_ISC_gp 0 /* Input/Sense Configuration group position. */
5605
#define PORT_ISC0_bm (1<<0) /* Input/Sense Configuration bit 0 mask. */
5606
#define PORT_ISC0_bp 0 /* Input/Sense Configuration bit 0 position. */
5607
#define PORT_ISC1_bm (1<<1) /* Input/Sense Configuration bit 1 mask. */
5608
#define PORT_ISC1_bp 1 /* Input/Sense Configuration bit 1 position. */
5609
#define PORT_ISC2_bm (1<<2) /* Input/Sense Configuration bit 2 mask. */
5610
#define PORT_ISC2_bp 2 /* Input/Sense Configuration bit 2 position. */
5613
/* PORT.PIN1CTRL bit masks and bit positions */
5614
/* PORT_SRLEN_bm Predefined. */
5615
/* PORT_SRLEN_bp Predefined. */
5617
/* PORT_INVEN_bm Predefined. */
5618
/* PORT_INVEN_bp Predefined. */
5620
/* PORT_OPC_gm Predefined. */
5621
/* PORT_OPC_gp Predefined. */
5622
/* PORT_OPC0_bm Predefined. */
5623
/* PORT_OPC0_bp Predefined. */
5624
/* PORT_OPC1_bm Predefined. */
5625
/* PORT_OPC1_bp Predefined. */
5626
/* PORT_OPC2_bm Predefined. */
5627
/* PORT_OPC2_bp Predefined. */
5629
/* PORT_ISC_gm Predefined. */
5630
/* PORT_ISC_gp Predefined. */
5631
/* PORT_ISC0_bm Predefined. */
5632
/* PORT_ISC0_bp Predefined. */
5633
/* PORT_ISC1_bm Predefined. */
5634
/* PORT_ISC1_bp Predefined. */
5635
/* PORT_ISC2_bm Predefined. */
5636
/* PORT_ISC2_bp Predefined. */
5639
/* PORT.PIN2CTRL bit masks and bit positions */
5640
/* PORT_SRLEN_bm Predefined. */
5641
/* PORT_SRLEN_bp Predefined. */
5643
/* PORT_INVEN_bm Predefined. */
5644
/* PORT_INVEN_bp Predefined. */
5646
/* PORT_OPC_gm Predefined. */
5647
/* PORT_OPC_gp Predefined. */
5648
/* PORT_OPC0_bm Predefined. */
5649
/* PORT_OPC0_bp Predefined. */
5650
/* PORT_OPC1_bm Predefined. */
5651
/* PORT_OPC1_bp Predefined. */
5652
/* PORT_OPC2_bm Predefined. */
5653
/* PORT_OPC2_bp Predefined. */
5655
/* PORT_ISC_gm Predefined. */
5656
/* PORT_ISC_gp Predefined. */
5657
/* PORT_ISC0_bm Predefined. */
5658
/* PORT_ISC0_bp Predefined. */
5659
/* PORT_ISC1_bm Predefined. */
5660
/* PORT_ISC1_bp Predefined. */
5661
/* PORT_ISC2_bm Predefined. */
5662
/* PORT_ISC2_bp Predefined. */
5665
/* PORT.PIN3CTRL bit masks and bit positions */
5666
/* PORT_SRLEN_bm Predefined. */
5667
/* PORT_SRLEN_bp Predefined. */
5669
/* PORT_INVEN_bm Predefined. */
5670
/* PORT_INVEN_bp Predefined. */
5672
/* PORT_OPC_gm Predefined. */
5673
/* PORT_OPC_gp Predefined. */
5674
/* PORT_OPC0_bm Predefined. */
5675
/* PORT_OPC0_bp Predefined. */
5676
/* PORT_OPC1_bm Predefined. */
5677
/* PORT_OPC1_bp Predefined. */
5678
/* PORT_OPC2_bm Predefined. */
5679
/* PORT_OPC2_bp Predefined. */
5681
/* PORT_ISC_gm Predefined. */
5682
/* PORT_ISC_gp Predefined. */
5683
/* PORT_ISC0_bm Predefined. */
5684
/* PORT_ISC0_bp Predefined. */
5685
/* PORT_ISC1_bm Predefined. */
5686
/* PORT_ISC1_bp Predefined. */
5687
/* PORT_ISC2_bm Predefined. */
5688
/* PORT_ISC2_bp Predefined. */
5691
/* PORT.PIN4CTRL bit masks and bit positions */
5692
/* PORT_SRLEN_bm Predefined. */
5693
/* PORT_SRLEN_bp Predefined. */
5695
/* PORT_INVEN_bm Predefined. */
5696
/* PORT_INVEN_bp Predefined. */
5698
/* PORT_OPC_gm Predefined. */
5699
/* PORT_OPC_gp Predefined. */
5700
/* PORT_OPC0_bm Predefined. */
5701
/* PORT_OPC0_bp Predefined. */
5702
/* PORT_OPC1_bm Predefined. */
5703
/* PORT_OPC1_bp Predefined. */
5704
/* PORT_OPC2_bm Predefined. */
5705
/* PORT_OPC2_bp Predefined. */
5707
/* PORT_ISC_gm Predefined. */
5708
/* PORT_ISC_gp Predefined. */
5709
/* PORT_ISC0_bm Predefined. */
5710
/* PORT_ISC0_bp Predefined. */
5711
/* PORT_ISC1_bm Predefined. */
5712
/* PORT_ISC1_bp Predefined. */
5713
/* PORT_ISC2_bm Predefined. */
5714
/* PORT_ISC2_bp Predefined. */
5717
/* PORT.PIN5CTRL bit masks and bit positions */
5718
/* PORT_SRLEN_bm Predefined. */
5719
/* PORT_SRLEN_bp Predefined. */
5721
/* PORT_INVEN_bm Predefined. */
5722
/* PORT_INVEN_bp Predefined. */
5724
/* PORT_OPC_gm Predefined. */
5725
/* PORT_OPC_gp Predefined. */
5726
/* PORT_OPC0_bm Predefined. */
5727
/* PORT_OPC0_bp Predefined. */
5728
/* PORT_OPC1_bm Predefined. */
5729
/* PORT_OPC1_bp Predefined. */
5730
/* PORT_OPC2_bm Predefined. */
5731
/* PORT_OPC2_bp Predefined. */
5733
/* PORT_ISC_gm Predefined. */
5734
/* PORT_ISC_gp Predefined. */
5735
/* PORT_ISC0_bm Predefined. */
5736
/* PORT_ISC0_bp Predefined. */
5737
/* PORT_ISC1_bm Predefined. */
5738
/* PORT_ISC1_bp Predefined. */
5739
/* PORT_ISC2_bm Predefined. */
5740
/* PORT_ISC2_bp Predefined. */
5743
/* PORT.PIN6CTRL bit masks and bit positions */
5744
/* PORT_SRLEN_bm Predefined. */
5745
/* PORT_SRLEN_bp Predefined. */
5747
/* PORT_INVEN_bm Predefined. */
5748
/* PORT_INVEN_bp Predefined. */
5750
/* PORT_OPC_gm Predefined. */
5751
/* PORT_OPC_gp Predefined. */
5752
/* PORT_OPC0_bm Predefined. */
5753
/* PORT_OPC0_bp Predefined. */
5754
/* PORT_OPC1_bm Predefined. */
5755
/* PORT_OPC1_bp Predefined. */
5756
/* PORT_OPC2_bm Predefined. */
5757
/* PORT_OPC2_bp Predefined. */
5759
/* PORT_ISC_gm Predefined. */
5760
/* PORT_ISC_gp Predefined. */
5761
/* PORT_ISC0_bm Predefined. */
5762
/* PORT_ISC0_bp Predefined. */
5763
/* PORT_ISC1_bm Predefined. */
5764
/* PORT_ISC1_bp Predefined. */
5765
/* PORT_ISC2_bm Predefined. */
5766
/* PORT_ISC2_bp Predefined. */
5769
/* PORT.PIN7CTRL bit masks and bit positions */
5770
/* PORT_SRLEN_bm Predefined. */
5771
/* PORT_SRLEN_bp Predefined. */
5773
/* PORT_INVEN_bm Predefined. */
5774
/* PORT_INVEN_bp Predefined. */
5776
/* PORT_OPC_gm Predefined. */
5777
/* PORT_OPC_gp Predefined. */
5778
/* PORT_OPC0_bm Predefined. */
5779
/* PORT_OPC0_bp Predefined. */
5780
/* PORT_OPC1_bm Predefined. */
5781
/* PORT_OPC1_bp Predefined. */
5782
/* PORT_OPC2_bm Predefined. */
5783
/* PORT_OPC2_bp Predefined. */
5785
/* PORT_ISC_gm Predefined. */
5786
/* PORT_ISC_gp Predefined. */
5787
/* PORT_ISC0_bm Predefined. */
5788
/* PORT_ISC0_bp Predefined. */
5789
/* PORT_ISC1_bm Predefined. */
5790
/* PORT_ISC1_bp Predefined. */
5791
/* PORT_ISC2_bm Predefined. */
5792
/* PORT_ISC2_bp Predefined. */
5795
/* TC - 16-bit Timer/Counter With PWM */
5796
/* TC0.CTRLA bit masks and bit positions */
5797
#define TC0_CLKSEL_gm 0x0F /* Clock Selection group mask. */
5798
#define TC0_CLKSEL_gp 0 /* Clock Selection group position. */
5799
#define TC0_CLKSEL0_bm (1<<0) /* Clock Selection bit 0 mask. */
5800
#define TC0_CLKSEL0_bp 0 /* Clock Selection bit 0 position. */
5801
#define TC0_CLKSEL1_bm (1<<1) /* Clock Selection bit 1 mask. */
5802
#define TC0_CLKSEL1_bp 1 /* Clock Selection bit 1 position. */
5803
#define TC0_CLKSEL2_bm (1<<2) /* Clock Selection bit 2 mask. */
5804
#define TC0_CLKSEL2_bp 2 /* Clock Selection bit 2 position. */
5805
#define TC0_CLKSEL3_bm (1<<3) /* Clock Selection bit 3 mask. */
5806
#define TC0_CLKSEL3_bp 3 /* Clock Selection bit 3 position. */
5809
/* TC0.CTRLB bit masks and bit positions */
5810
#define TC0_CCDEN_bm 0x80 /* Compare or Capture D Enable bit mask. */
5811
#define TC0_CCDEN_bp 7 /* Compare or Capture D Enable bit position. */
5813
#define TC0_CCCEN_bm 0x40 /* Compare or Capture C Enable bit mask. */
5814
#define TC0_CCCEN_bp 6 /* Compare or Capture C Enable bit position. */
5816
#define TC0_CCBEN_bm 0x20 /* Compare or Capture B Enable bit mask. */
5817
#define TC0_CCBEN_bp 5 /* Compare or Capture B Enable bit position. */
5819
#define TC0_CCAEN_bm 0x10 /* Compare or Capture A Enable bit mask. */
5820
#define TC0_CCAEN_bp 4 /* Compare or Capture A Enable bit position. */
5822
#define TC0_WGMODE_gm 0x07 /* Waveform generation mode group mask. */
5823
#define TC0_WGMODE_gp 0 /* Waveform generation mode group position. */
5824
#define TC0_WGMODE0_bm (1<<0) /* Waveform generation mode bit 0 mask. */
5825
#define TC0_WGMODE0_bp 0 /* Waveform generation mode bit 0 position. */
5826
#define TC0_WGMODE1_bm (1<<1) /* Waveform generation mode bit 1 mask. */
5827
#define TC0_WGMODE1_bp 1 /* Waveform generation mode bit 1 position. */
5828
#define TC0_WGMODE2_bm (1<<2) /* Waveform generation mode bit 2 mask. */
5829
#define TC0_WGMODE2_bp 2 /* Waveform generation mode bit 2 position. */
5832
/* TC0.CTRLC bit masks and bit positions */
5833
#define TC0_CMPD_bm 0x08 /* Compare D Output Value bit mask. */
5834
#define TC0_CMPD_bp 3 /* Compare D Output Value bit position. */
5836
#define TC0_CMPC_bm 0x04 /* Compare C Output Value bit mask. */
5837
#define TC0_CMPC_bp 2 /* Compare C Output Value bit position. */
5839
#define TC0_CMPB_bm 0x02 /* Compare B Output Value bit mask. */
5840
#define TC0_CMPB_bp 1 /* Compare B Output Value bit position. */
5842
#define TC0_CMPA_bm 0x01 /* Compare A Output Value bit mask. */
5843
#define TC0_CMPA_bp 0 /* Compare A Output Value bit position. */
5846
/* TC0.CTRLD bit masks and bit positions */
5847
#define TC0_EVACT_gm 0xE0 /* Event Action group mask. */
5848
#define TC0_EVACT_gp 5 /* Event Action group position. */
5849
#define TC0_EVACT0_bm (1<<5) /* Event Action bit 0 mask. */
5850
#define TC0_EVACT0_bp 5 /* Event Action bit 0 position. */
5851
#define TC0_EVACT1_bm (1<<6) /* Event Action bit 1 mask. */
5852
#define TC0_EVACT1_bp 6 /* Event Action bit 1 position. */
5853
#define TC0_EVACT2_bm (1<<7) /* Event Action bit 2 mask. */
5854
#define TC0_EVACT2_bp 7 /* Event Action bit 2 position. */
5856
#define TC0_EVDLY_bm 0x10 /* Event Delay bit mask. */
5857
#define TC0_EVDLY_bp 4 /* Event Delay bit position. */
5859
#define TC0_EVSEL_gm 0x0F /* Event Source Select group mask. */
5860
#define TC0_EVSEL_gp 0 /* Event Source Select group position. */
5861
#define TC0_EVSEL0_bm (1<<0) /* Event Source Select bit 0 mask. */
5862
#define TC0_EVSEL0_bp 0 /* Event Source Select bit 0 position. */
5863
#define TC0_EVSEL1_bm (1<<1) /* Event Source Select bit 1 mask. */
5864
#define TC0_EVSEL1_bp 1 /* Event Source Select bit 1 position. */
5865
#define TC0_EVSEL2_bm (1<<2) /* Event Source Select bit 2 mask. */
5866
#define TC0_EVSEL2_bp 2 /* Event Source Select bit 2 position. */
5867
#define TC0_EVSEL3_bm (1<<3) /* Event Source Select bit 3 mask. */
5868
#define TC0_EVSEL3_bp 3 /* Event Source Select bit 3 position. */
5871
/* TC0.CTRLE bit masks and bit positions */
5872
#define TC0_DTHM_bm 0x02 /* Dead Time Hold Mode bit mask. */
5873
#define TC0_DTHM_bp 1 /* Dead Time Hold Mode bit position. */
5875
#define TC0_BYTEM_bm 0x01 /* Byte Mode bit mask. */
5876
#define TC0_BYTEM_bp 0 /* Byte Mode bit position. */
5879
/* TC0.INTCTRLA bit masks and bit positions */
5880
#define TC0_ERRINTLVL_gm 0x0C /* Error Interrupt Level group mask. */
5881
#define TC0_ERRINTLVL_gp 2 /* Error Interrupt Level group position. */
5882
#define TC0_ERRINTLVL0_bm (1<<2) /* Error Interrupt Level bit 0 mask. */
5883
#define TC0_ERRINTLVL0_bp 2 /* Error Interrupt Level bit 0 position. */
5884
#define TC0_ERRINTLVL1_bm (1<<3) /* Error Interrupt Level bit 1 mask. */
5885
#define TC0_ERRINTLVL1_bp 3 /* Error Interrupt Level bit 1 position. */
5887
#define TC0_OVFINTLVL_gm 0x03 /* Overflow interrupt level group mask. */
5888
#define TC0_OVFINTLVL_gp 0 /* Overflow interrupt level group position. */
5889
#define TC0_OVFINTLVL0_bm (1<<0) /* Overflow interrupt level bit 0 mask. */
5890
#define TC0_OVFINTLVL0_bp 0 /* Overflow interrupt level bit 0 position. */
5891
#define TC0_OVFINTLVL1_bm (1<<1) /* Overflow interrupt level bit 1 mask. */
5892
#define TC0_OVFINTLVL1_bp 1 /* Overflow interrupt level bit 1 position. */
5895
/* TC0.INTCTRLB bit masks and bit positions */
5896
#define TC0_CCDINTLVL_gm 0xC0 /* Compare or Capture D Interrupt Level group mask. */
5897
#define TC0_CCDINTLVL_gp 6 /* Compare or Capture D Interrupt Level group position. */
5898
#define TC0_CCDINTLVL0_bm (1<<6) /* Compare or Capture D Interrupt Level bit 0 mask. */
5899
#define TC0_CCDINTLVL0_bp 6 /* Compare or Capture D Interrupt Level bit 0 position. */
5900
#define TC0_CCDINTLVL1_bm (1<<7) /* Compare or Capture D Interrupt Level bit 1 mask. */
5901
#define TC0_CCDINTLVL1_bp 7 /* Compare or Capture D Interrupt Level bit 1 position. */
5903
#define TC0_CCCINTLVL_gm 0x30 /* Compare or Capture C Interrupt Level group mask. */
5904
#define TC0_CCCINTLVL_gp 4 /* Compare or Capture C Interrupt Level group position. */
5905
#define TC0_CCCINTLVL0_bm (1<<4) /* Compare or Capture C Interrupt Level bit 0 mask. */
5906
#define TC0_CCCINTLVL0_bp 4 /* Compare or Capture C Interrupt Level bit 0 position. */
5907
#define TC0_CCCINTLVL1_bm (1<<5) /* Compare or Capture C Interrupt Level bit 1 mask. */
5908
#define TC0_CCCINTLVL1_bp 5 /* Compare or Capture C Interrupt Level bit 1 position. */
5910
#define TC0_CCBINTLVL_gm 0x0C /* Compare or Capture B Interrupt Level group mask. */
5911
#define TC0_CCBINTLVL_gp 2 /* Compare or Capture B Interrupt Level group position. */
5912
#define TC0_CCBINTLVL0_bm (1<<2) /* Compare or Capture B Interrupt Level bit 0 mask. */
5913
#define TC0_CCBINTLVL0_bp 2 /* Compare or Capture B Interrupt Level bit 0 position. */
5914
#define TC0_CCBINTLVL1_bm (1<<3) /* Compare or Capture B Interrupt Level bit 1 mask. */
5915
#define TC0_CCBINTLVL1_bp 3 /* Compare or Capture B Interrupt Level bit 1 position. */
5917
#define TC0_CCAINTLVL_gm 0x03 /* Compare or Capture A Interrupt Level group mask. */
5918
#define TC0_CCAINTLVL_gp 0 /* Compare or Capture A Interrupt Level group position. */
5919
#define TC0_CCAINTLVL0_bm (1<<0) /* Compare or Capture A Interrupt Level bit 0 mask. */
5920
#define TC0_CCAINTLVL0_bp 0 /* Compare or Capture A Interrupt Level bit 0 position. */
5921
#define TC0_CCAINTLVL1_bm (1<<1) /* Compare or Capture A Interrupt Level bit 1 mask. */
5922
#define TC0_CCAINTLVL1_bp 1 /* Compare or Capture A Interrupt Level bit 1 position. */
5925
/* TC0.CTRLFCLR bit masks and bit positions */
5926
#define TC0_CMD_gm 0x0C /* Command group mask. */
5927
#define TC0_CMD_gp 2 /* Command group position. */
5928
#define TC0_CMD0_bm (1<<2) /* Command bit 0 mask. */
5929
#define TC0_CMD0_bp 2 /* Command bit 0 position. */
5930
#define TC0_CMD1_bm (1<<3) /* Command bit 1 mask. */
5931
#define TC0_CMD1_bp 3 /* Command bit 1 position. */
5933
#define TC0_LUPD_bm 0x02 /* Lock Update bit mask. */
5934
#define TC0_LUPD_bp 1 /* Lock Update bit position. */
5936
#define TC0_DIR_bm 0x01 /* Direction bit mask. */
5937
#define TC0_DIR_bp 0 /* Direction bit position. */
5940
/* TC0.CTRLFSET bit masks and bit positions */
5941
/* TC0_CMD_gm Predefined. */
5942
/* TC0_CMD_gp Predefined. */
5943
/* TC0_CMD0_bm Predefined. */
5944
/* TC0_CMD0_bp Predefined. */
5945
/* TC0_CMD1_bm Predefined. */
5946
/* TC0_CMD1_bp Predefined. */
5948
/* TC0_LUPD_bm Predefined. */
5949
/* TC0_LUPD_bp Predefined. */
5951
/* TC0_DIR_bm Predefined. */
5952
/* TC0_DIR_bp Predefined. */
5955
/* TC0.CTRLGCLR bit masks and bit positions */
5956
#define TC0_CCDBV_bm 0x10 /* Compare or Capture D Buffer Valid bit mask. */
5957
#define TC0_CCDBV_bp 4 /* Compare or Capture D Buffer Valid bit position. */
5959
#define TC0_CCCBV_bm 0x08 /* Compare or Capture C Buffer Valid bit mask. */
5960
#define TC0_CCCBV_bp 3 /* Compare or Capture C Buffer Valid bit position. */
5962
#define TC0_CCBBV_bm 0x04 /* Compare or Capture B Buffer Valid bit mask. */
5963
#define TC0_CCBBV_bp 2 /* Compare or Capture B Buffer Valid bit position. */
5965
#define TC0_CCABV_bm 0x02 /* Compare or Capture A Buffer Valid bit mask. */
5966
#define TC0_CCABV_bp 1 /* Compare or Capture A Buffer Valid bit position. */
5968
#define TC0_PERBV_bm 0x01 /* Period Buffer Valid bit mask. */
5969
#define TC0_PERBV_bp 0 /* Period Buffer Valid bit position. */
5972
/* TC0.CTRLGSET bit masks and bit positions */
5973
/* TC0_CCDBV_bm Predefined. */
5974
/* TC0_CCDBV_bp Predefined. */
5976
/* TC0_CCCBV_bm Predefined. */
5977
/* TC0_CCCBV_bp Predefined. */
5979
/* TC0_CCBBV_bm Predefined. */
5980
/* TC0_CCBBV_bp Predefined. */
5982
/* TC0_CCABV_bm Predefined. */
5983
/* TC0_CCABV_bp Predefined. */
5985
/* TC0_PERBV_bm Predefined. */
5986
/* TC0_PERBV_bp Predefined. */
5989
/* TC0.INTFLAGS bit masks and bit positions */
5990
#define TC0_CCDIF_bm 0x80 /* Compare or Capture D Interrupt Flag bit mask. */
5991
#define TC0_CCDIF_bp 7 /* Compare or Capture D Interrupt Flag bit position. */
5993
#define TC0_CCCIF_bm 0x40 /* Compare or Capture C Interrupt Flag bit mask. */
5994
#define TC0_CCCIF_bp 6 /* Compare or Capture C Interrupt Flag bit position. */
5996
#define TC0_CCBIF_bm 0x20 /* Compare or Capture B Interrupt Flag bit mask. */
5997
#define TC0_CCBIF_bp 5 /* Compare or Capture B Interrupt Flag bit position. */
5999
#define TC0_CCAIF_bm 0x10 /* Compare or Capture A Interrupt Flag bit mask. */
6000
#define TC0_CCAIF_bp 4 /* Compare or Capture A Interrupt Flag bit position. */
6002
#define TC0_ERRIF_bm 0x02 /* Error Interrupt Flag bit mask. */
6003
#define TC0_ERRIF_bp 1 /* Error Interrupt Flag bit position. */
6005
#define TC0_OVFIF_bm 0x01 /* Overflow Interrupt Flag bit mask. */
6006
#define TC0_OVFIF_bp 0 /* Overflow Interrupt Flag bit position. */
6009
/* TC1.CTRLA bit masks and bit positions */
6010
#define TC1_CLKSEL_gm 0x0F /* Clock Selection group mask. */
6011
#define TC1_CLKSEL_gp 0 /* Clock Selection group position. */
6012
#define TC1_CLKSEL0_bm (1<<0) /* Clock Selection bit 0 mask. */
6013
#define TC1_CLKSEL0_bp 0 /* Clock Selection bit 0 position. */
6014
#define TC1_CLKSEL1_bm (1<<1) /* Clock Selection bit 1 mask. */
6015
#define TC1_CLKSEL1_bp 1 /* Clock Selection bit 1 position. */
6016
#define TC1_CLKSEL2_bm (1<<2) /* Clock Selection bit 2 mask. */
6017
#define TC1_CLKSEL2_bp 2 /* Clock Selection bit 2 position. */
6018
#define TC1_CLKSEL3_bm (1<<3) /* Clock Selection bit 3 mask. */
6019
#define TC1_CLKSEL3_bp 3 /* Clock Selection bit 3 position. */
6022
/* TC1.CTRLB bit masks and bit positions */
6023
#define TC1_CCBEN_bm 0x20 /* Compare or Capture B Enable bit mask. */
6024
#define TC1_CCBEN_bp 5 /* Compare or Capture B Enable bit position. */
6026
#define TC1_CCAEN_bm 0x10 /* Compare or Capture A Enable bit mask. */
6027
#define TC1_CCAEN_bp 4 /* Compare or Capture A Enable bit position. */
6029
#define TC1_WGMODE_gm 0x07 /* Waveform generation mode group mask. */
6030
#define TC1_WGMODE_gp 0 /* Waveform generation mode group position. */
6031
#define TC1_WGMODE0_bm (1<<0) /* Waveform generation mode bit 0 mask. */
6032
#define TC1_WGMODE0_bp 0 /* Waveform generation mode bit 0 position. */
6033
#define TC1_WGMODE1_bm (1<<1) /* Waveform generation mode bit 1 mask. */
6034
#define TC1_WGMODE1_bp 1 /* Waveform generation mode bit 1 position. */
6035
#define TC1_WGMODE2_bm (1<<2) /* Waveform generation mode bit 2 mask. */
6036
#define TC1_WGMODE2_bp 2 /* Waveform generation mode bit 2 position. */
6039
/* TC1.CTRLC bit masks and bit positions */
6040
#define TC1_CMPB_bm 0x02 /* Compare B Output Value bit mask. */
6041
#define TC1_CMPB_bp 1 /* Compare B Output Value bit position. */
6043
#define TC1_CMPA_bm 0x01 /* Compare A Output Value bit mask. */
6044
#define TC1_CMPA_bp 0 /* Compare A Output Value bit position. */
6047
/* TC1.CTRLD bit masks and bit positions */
6048
#define TC1_EVACT_gm 0xE0 /* Event Action group mask. */
6049
#define TC1_EVACT_gp 5 /* Event Action group position. */
6050
#define TC1_EVACT0_bm (1<<5) /* Event Action bit 0 mask. */
6051
#define TC1_EVACT0_bp 5 /* Event Action bit 0 position. */
6052
#define TC1_EVACT1_bm (1<<6) /* Event Action bit 1 mask. */
6053
#define TC1_EVACT1_bp 6 /* Event Action bit 1 position. */
6054
#define TC1_EVACT2_bm (1<<7) /* Event Action bit 2 mask. */
6055
#define TC1_EVACT2_bp 7 /* Event Action bit 2 position. */
6057
#define TC1_EVDLY_bm 0x10 /* Event Delay bit mask. */
6058
#define TC1_EVDLY_bp 4 /* Event Delay bit position. */
6060
#define TC1_EVSEL_gm 0x0F /* Event Source Select group mask. */
6061
#define TC1_EVSEL_gp 0 /* Event Source Select group position. */
6062
#define TC1_EVSEL0_bm (1<<0) /* Event Source Select bit 0 mask. */
6063
#define TC1_EVSEL0_bp 0 /* Event Source Select bit 0 position. */
6064
#define TC1_EVSEL1_bm (1<<1) /* Event Source Select bit 1 mask. */
6065
#define TC1_EVSEL1_bp 1 /* Event Source Select bit 1 position. */
6066
#define TC1_EVSEL2_bm (1<<2) /* Event Source Select bit 2 mask. */
6067
#define TC1_EVSEL2_bp 2 /* Event Source Select bit 2 position. */
6068
#define TC1_EVSEL3_bm (1<<3) /* Event Source Select bit 3 mask. */
6069
#define TC1_EVSEL3_bp 3 /* Event Source Select bit 3 position. */
6072
/* TC1.CTRLE bit masks and bit positions */
6073
#define TC1_DTHM_bm 0x02 /* Dead Time Hold Mode bit mask. */
6074
#define TC1_DTHM_bp 1 /* Dead Time Hold Mode bit position. */
6076
#define TC1_BYTEM_bm 0x01 /* Byte Mode bit mask. */
6077
#define TC1_BYTEM_bp 0 /* Byte Mode bit position. */
6080
/* TC1.INTCTRLA bit masks and bit positions */
6081
#define TC1_ERRINTLVL_gm 0x0C /* Error Interrupt Level group mask. */
6082
#define TC1_ERRINTLVL_gp 2 /* Error Interrupt Level group position. */
6083
#define TC1_ERRINTLVL0_bm (1<<2) /* Error Interrupt Level bit 0 mask. */
6084
#define TC1_ERRINTLVL0_bp 2 /* Error Interrupt Level bit 0 position. */
6085
#define TC1_ERRINTLVL1_bm (1<<3) /* Error Interrupt Level bit 1 mask. */
6086
#define TC1_ERRINTLVL1_bp 3 /* Error Interrupt Level bit 1 position. */
6088
#define TC1_OVFINTLVL_gm 0x03 /* Overflow interrupt level group mask. */
6089
#define TC1_OVFINTLVL_gp 0 /* Overflow interrupt level group position. */
6090
#define TC1_OVFINTLVL0_bm (1<<0) /* Overflow interrupt level bit 0 mask. */
6091
#define TC1_OVFINTLVL0_bp 0 /* Overflow interrupt level bit 0 position. */
6092
#define TC1_OVFINTLVL1_bm (1<<1) /* Overflow interrupt level bit 1 mask. */
6093
#define TC1_OVFINTLVL1_bp 1 /* Overflow interrupt level bit 1 position. */
6096
/* TC1.INTCTRLB bit masks and bit positions */
6097
#define TC1_CCBINTLVL_gm 0x0C /* Compare or Capture B Interrupt Level group mask. */
6098
#define TC1_CCBINTLVL_gp 2 /* Compare or Capture B Interrupt Level group position. */
6099
#define TC1_CCBINTLVL0_bm (1<<2) /* Compare or Capture B Interrupt Level bit 0 mask. */
6100
#define TC1_CCBINTLVL0_bp 2 /* Compare or Capture B Interrupt Level bit 0 position. */
6101
#define TC1_CCBINTLVL1_bm (1<<3) /* Compare or Capture B Interrupt Level bit 1 mask. */
6102
#define TC1_CCBINTLVL1_bp 3 /* Compare or Capture B Interrupt Level bit 1 position. */
6104
#define TC1_CCAINTLVL_gm 0x03 /* Compare or Capture A Interrupt Level group mask. */
6105
#define TC1_CCAINTLVL_gp 0 /* Compare or Capture A Interrupt Level group position. */
6106
#define TC1_CCAINTLVL0_bm (1<<0) /* Compare or Capture A Interrupt Level bit 0 mask. */
6107
#define TC1_CCAINTLVL0_bp 0 /* Compare or Capture A Interrupt Level bit 0 position. */
6108
#define TC1_CCAINTLVL1_bm (1<<1) /* Compare or Capture A Interrupt Level bit 1 mask. */
6109
#define TC1_CCAINTLVL1_bp 1 /* Compare or Capture A Interrupt Level bit 1 position. */
6112
/* TC1.CTRLFCLR bit masks and bit positions */
6113
#define TC1_CMD_gm 0x0C /* Command group mask. */
6114
#define TC1_CMD_gp 2 /* Command group position. */
6115
#define TC1_CMD0_bm (1<<2) /* Command bit 0 mask. */
6116
#define TC1_CMD0_bp 2 /* Command bit 0 position. */
6117
#define TC1_CMD1_bm (1<<3) /* Command bit 1 mask. */
6118
#define TC1_CMD1_bp 3 /* Command bit 1 position. */
6120
#define TC1_LUPD_bm 0x02 /* Lock Update bit mask. */
6121
#define TC1_LUPD_bp 1 /* Lock Update bit position. */
6123
#define TC1_DIR_bm 0x01 /* Direction bit mask. */
6124
#define TC1_DIR_bp 0 /* Direction bit position. */
6127
/* TC1.CTRLFSET bit masks and bit positions */
6128
/* TC1_CMD_gm Predefined. */
6129
/* TC1_CMD_gp Predefined. */
6130
/* TC1_CMD0_bm Predefined. */
6131
/* TC1_CMD0_bp Predefined. */
6132
/* TC1_CMD1_bm Predefined. */
6133
/* TC1_CMD1_bp Predefined. */
6135
/* TC1_LUPD_bm Predefined. */
6136
/* TC1_LUPD_bp Predefined. */
6138
/* TC1_DIR_bm Predefined. */
6139
/* TC1_DIR_bp Predefined. */
6142
/* TC1.CTRLGCLR bit masks and bit positions */
6143
#define TC1_CCBBV_bm 0x04 /* Compare or Capture B Buffer Valid bit mask. */
6144
#define TC1_CCBBV_bp 2 /* Compare or Capture B Buffer Valid bit position. */
6146
#define TC1_CCABV_bm 0x02 /* Compare or Capture A Buffer Valid bit mask. */
6147
#define TC1_CCABV_bp 1 /* Compare or Capture A Buffer Valid bit position. */
6149
#define TC1_PERBV_bm 0x01 /* Period Buffer Valid bit mask. */
6150
#define TC1_PERBV_bp 0 /* Period Buffer Valid bit position. */
6153
/* TC1.CTRLGSET bit masks and bit positions */
6154
/* TC1_CCBBV_bm Predefined. */
6155
/* TC1_CCBBV_bp Predefined. */
6157
/* TC1_CCABV_bm Predefined. */
6158
/* TC1_CCABV_bp Predefined. */
6160
/* TC1_PERBV_bm Predefined. */
6161
/* TC1_PERBV_bp Predefined. */
6164
/* TC1.INTFLAGS bit masks and bit positions */
6165
#define TC1_CCBIF_bm 0x20 /* Compare or Capture B Interrupt Flag bit mask. */
6166
#define TC1_CCBIF_bp 5 /* Compare or Capture B Interrupt Flag bit position. */
6168
#define TC1_CCAIF_bm 0x10 /* Compare or Capture A Interrupt Flag bit mask. */
6169
#define TC1_CCAIF_bp 4 /* Compare or Capture A Interrupt Flag bit position. */
6171
#define TC1_ERRIF_bm 0x02 /* Error Interrupt Flag bit mask. */
6172
#define TC1_ERRIF_bp 1 /* Error Interrupt Flag bit position. */
6174
#define TC1_OVFIF_bm 0x01 /* Overflow Interrupt Flag bit mask. */
6175
#define TC1_OVFIF_bp 0 /* Overflow Interrupt Flag bit position. */
6178
/* AWEX.CTRL bit masks and bit positions */
6179
#define AWEX_PGM_bm 0x20 /* Pattern Generation Mode bit mask. */
6180
#define AWEX_PGM_bp 5 /* Pattern Generation Mode bit position. */
6182
#define AWEX_CWCM_bm 0x10 /* Common Waveform Channel Mode bit mask. */
6183
#define AWEX_CWCM_bp 4 /* Common Waveform Channel Mode bit position. */
6185
#define AWEX_DTICCDEN_bm 0x08 /* Dead Time Insertion Compare Channel D Enable bit mask. */
6186
#define AWEX_DTICCDEN_bp 3 /* Dead Time Insertion Compare Channel D Enable bit position. */
6188
#define AWEX_DTICCCEN_bm 0x04 /* Dead Time Insertion Compare Channel C Enable bit mask. */
6189
#define AWEX_DTICCCEN_bp 2 /* Dead Time Insertion Compare Channel C Enable bit position. */
6191
#define AWEX_DTICCBEN_bm 0x02 /* Dead Time Insertion Compare Channel B Enable bit mask. */
6192
#define AWEX_DTICCBEN_bp 1 /* Dead Time Insertion Compare Channel B Enable bit position. */
6194
#define AWEX_DTICCAEN_bm 0x01 /* Dead Time Insertion Compare Channel A Enable bit mask. */
6195
#define AWEX_DTICCAEN_bp 0 /* Dead Time Insertion Compare Channel A Enable bit position. */
6198
/* AWEX.FDCTRL bit masks and bit positions */
6199
#define AWEX_FDDBD_bm 0x10 /* Fault Detect on Disable Break Disable bit mask. */
6200
#define AWEX_FDDBD_bp 4 /* Fault Detect on Disable Break Disable bit position. */
6202
#define AWEX_FDMODE_bm 0x04 /* Fault Detect Mode bit mask. */
6203
#define AWEX_FDMODE_bp 2 /* Fault Detect Mode bit position. */
6205
#define AWEX_FDACT_gm 0x03 /* Fault Detect Action group mask. */
6206
#define AWEX_FDACT_gp 0 /* Fault Detect Action group position. */
6207
#define AWEX_FDACT0_bm (1<<0) /* Fault Detect Action bit 0 mask. */
6208
#define AWEX_FDACT0_bp 0 /* Fault Detect Action bit 0 position. */
6209
#define AWEX_FDACT1_bm (1<<1) /* Fault Detect Action bit 1 mask. */
6210
#define AWEX_FDACT1_bp 1 /* Fault Detect Action bit 1 position. */
6213
/* AWEX.STATUS bit masks and bit positions */
6214
#define AWEX_FDF_bm 0x04 /* Fault Detect Flag bit mask. */
6215
#define AWEX_FDF_bp 2 /* Fault Detect Flag bit position. */
6217
#define AWEX_DTHSBUFV_bm 0x02 /* Dead Time High Side Buffer Valid bit mask. */
6218
#define AWEX_DTHSBUFV_bp 1 /* Dead Time High Side Buffer Valid bit position. */
6220
#define AWEX_DTLSBUFV_bm 0x01 /* Dead Time Low Side Buffer Valid bit mask. */
6221
#define AWEX_DTLSBUFV_bp 0 /* Dead Time Low Side Buffer Valid bit position. */
6224
/* HIRES.CTRL bit masks and bit positions */
6225
#define HIRES_HREN_gm 0x03 /* High Resolution Enable group mask. */
6226
#define HIRES_HREN_gp 0 /* High Resolution Enable group position. */
6227
#define HIRES_HREN0_bm (1<<0) /* High Resolution Enable bit 0 mask. */
6228
#define HIRES_HREN0_bp 0 /* High Resolution Enable bit 0 position. */
6229
#define HIRES_HREN1_bm (1<<1) /* High Resolution Enable bit 1 mask. */
6230
#define HIRES_HREN1_bp 1 /* High Resolution Enable bit 1 position. */
6233
/* USART - Universal Asynchronous Receiver-Transmitter */
6234
/* USART.STATUS bit masks and bit positions */
6235
#define USART_RXCIF_bm 0x80 /* Receive Interrupt Flag bit mask. */
6236
#define USART_RXCIF_bp 7 /* Receive Interrupt Flag bit position. */
6238
#define USART_TXCIF_bm 0x40 /* Transmit Interrupt Flag bit mask. */
6239
#define USART_TXCIF_bp 6 /* Transmit Interrupt Flag bit position. */
6241
#define USART_DREIF_bm 0x20 /* Data Register Empty Flag bit mask. */
6242
#define USART_DREIF_bp 5 /* Data Register Empty Flag bit position. */
6244
#define USART_FERR_bm 0x10 /* Frame Error bit mask. */
6245
#define USART_FERR_bp 4 /* Frame Error bit position. */
6247
#define USART_BUFOVF_bm 0x08 /* Buffer Overflow bit mask. */
6248
#define USART_BUFOVF_bp 3 /* Buffer Overflow bit position. */
6250
#define USART_PERR_bm 0x04 /* Parity Error bit mask. */
6251
#define USART_PERR_bp 2 /* Parity Error bit position. */
6253
#define USART_RXB8_bm 0x01 /* Receive Bit 8 bit mask. */
6254
#define USART_RXB8_bp 0 /* Receive Bit 8 bit position. */
6257
/* USART.CTRLA bit masks and bit positions */
6258
#define USART_RXCINTLVL_gm 0x30 /* Receive Interrupt Level group mask. */
6259
#define USART_RXCINTLVL_gp 4 /* Receive Interrupt Level group position. */
6260
#define USART_RXCINTLVL0_bm (1<<4) /* Receive Interrupt Level bit 0 mask. */
6261
#define USART_RXCINTLVL0_bp 4 /* Receive Interrupt Level bit 0 position. */
6262
#define USART_RXCINTLVL1_bm (1<<5) /* Receive Interrupt Level bit 1 mask. */
6263
#define USART_RXCINTLVL1_bp 5 /* Receive Interrupt Level bit 1 position. */
6265
#define USART_TXCINTLVL_gm 0x0C /* Transmit Interrupt Level group mask. */
6266
#define USART_TXCINTLVL_gp 2 /* Transmit Interrupt Level group position. */
6267
#define USART_TXCINTLVL0_bm (1<<2) /* Transmit Interrupt Level bit 0 mask. */
6268
#define USART_TXCINTLVL0_bp 2 /* Transmit Interrupt Level bit 0 position. */
6269
#define USART_TXCINTLVL1_bm (1<<3) /* Transmit Interrupt Level bit 1 mask. */
6270
#define USART_TXCINTLVL1_bp 3 /* Transmit Interrupt Level bit 1 position. */
6272
#define USART_DREINTLVL_gm 0x03 /* Data Register Empty Interrupt Level group mask. */
6273
#define USART_DREINTLVL_gp 0 /* Data Register Empty Interrupt Level group position. */
6274
#define USART_DREINTLVL0_bm (1<<0) /* Data Register Empty Interrupt Level bit 0 mask. */
6275
#define USART_DREINTLVL0_bp 0 /* Data Register Empty Interrupt Level bit 0 position. */
6276
#define USART_DREINTLVL1_bm (1<<1) /* Data Register Empty Interrupt Level bit 1 mask. */
6277
#define USART_DREINTLVL1_bp 1 /* Data Register Empty Interrupt Level bit 1 position. */
6280
/* USART.CTRLB bit masks and bit positions */
6281
#define USART_RXEN_bm 0x10 /* Receiver Enable bit mask. */
6282
#define USART_RXEN_bp 4 /* Receiver Enable bit position. */
6284
#define USART_TXEN_bm 0x08 /* Transmitter Enable bit mask. */
6285
#define USART_TXEN_bp 3 /* Transmitter Enable bit position. */
6287
#define USART_CLK2X_bm 0x04 /* Double transmission speed bit mask. */
6288
#define USART_CLK2X_bp 2 /* Double transmission speed bit position. */
6290
#define USART_MPCM_bm 0x02 /* Multi-processor Communication Mode bit mask. */
6291
#define USART_MPCM_bp 1 /* Multi-processor Communication Mode bit position. */
6293
#define USART_TXB8_bm 0x01 /* Transmit bit 8 bit mask. */
6294
#define USART_TXB8_bp 0 /* Transmit bit 8 bit position. */
6297
/* USART.CTRLC bit masks and bit positions */
6298
#define USART_CMODE_gm 0xC0 /* Communication Mode group mask. */
6299
#define USART_CMODE_gp 6 /* Communication Mode group position. */
6300
#define USART_CMODE0_bm (1<<6) /* Communication Mode bit 0 mask. */
6301
#define USART_CMODE0_bp 6 /* Communication Mode bit 0 position. */
6302
#define USART_CMODE1_bm (1<<7) /* Communication Mode bit 1 mask. */
6303
#define USART_CMODE1_bp 7 /* Communication Mode bit 1 position. */
6305
#define USART_PMODE_gm 0x30 /* Parity Mode group mask. */
6306
#define USART_PMODE_gp 4 /* Parity Mode group position. */
6307
#define USART_PMODE0_bm (1<<4) /* Parity Mode bit 0 mask. */
6308
#define USART_PMODE0_bp 4 /* Parity Mode bit 0 position. */
6309
#define USART_PMODE1_bm (1<<5) /* Parity Mode bit 1 mask. */
6310
#define USART_PMODE1_bp 5 /* Parity Mode bit 1 position. */
6312
#define USART_SBMODE_bm 0x08 /* Stop Bit Mode bit mask. */
6313
#define USART_SBMODE_bp 3 /* Stop Bit Mode bit position. */
6315
#define USART_CHSIZE_gm 0x07 /* Character Size group mask. */
6316
#define USART_CHSIZE_gp 0 /* Character Size group position. */
6317
#define USART_CHSIZE0_bm (1<<0) /* Character Size bit 0 mask. */
6318
#define USART_CHSIZE0_bp 0 /* Character Size bit 0 position. */
6319
#define USART_CHSIZE1_bm (1<<1) /* Character Size bit 1 mask. */
6320
#define USART_CHSIZE1_bp 1 /* Character Size bit 1 position. */
6321
#define USART_CHSIZE2_bm (1<<2) /* Character Size bit 2 mask. */
6322
#define USART_CHSIZE2_bp 2 /* Character Size bit 2 position. */
6325
/* USART.BAUDCTRLA bit masks and bit positions */
6326
#define USART_BSEL_gm 0xFF /* Baud Rate Selection Bits [7:0] group mask. */
6327
#define USART_BSEL_gp 0 /* Baud Rate Selection Bits [7:0] group position. */
6328
#define USART_BSEL0_bm (1<<0) /* Baud Rate Selection Bits [7:0] bit 0 mask. */
6329
#define USART_BSEL0_bp 0 /* Baud Rate Selection Bits [7:0] bit 0 position. */
6330
#define USART_BSEL1_bm (1<<1) /* Baud Rate Selection Bits [7:0] bit 1 mask. */
6331
#define USART_BSEL1_bp 1 /* Baud Rate Selection Bits [7:0] bit 1 position. */
6332
#define USART_BSEL2_bm (1<<2) /* Baud Rate Selection Bits [7:0] bit 2 mask. */
6333
#define USART_BSEL2_bp 2 /* Baud Rate Selection Bits [7:0] bit 2 position. */
6334
#define USART_BSEL3_bm (1<<3) /* Baud Rate Selection Bits [7:0] bit 3 mask. */
6335
#define USART_BSEL3_bp 3 /* Baud Rate Selection Bits [7:0] bit 3 position. */
6336
#define USART_BSEL4_bm (1<<4) /* Baud Rate Selection Bits [7:0] bit 4 mask. */
6337
#define USART_BSEL4_bp 4 /* Baud Rate Selection Bits [7:0] bit 4 position. */
6338
#define USART_BSEL5_bm (1<<5) /* Baud Rate Selection Bits [7:0] bit 5 mask. */
6339
#define USART_BSEL5_bp 5 /* Baud Rate Selection Bits [7:0] bit 5 position. */
6340
#define USART_BSEL6_bm (1<<6) /* Baud Rate Selection Bits [7:0] bit 6 mask. */
6341
#define USART_BSEL6_bp 6 /* Baud Rate Selection Bits [7:0] bit 6 position. */
6342
#define USART_BSEL7_bm (1<<7) /* Baud Rate Selection Bits [7:0] bit 7 mask. */
6343
#define USART_BSEL7_bp 7 /* Baud Rate Selection Bits [7:0] bit 7 position. */
6346
/* USART.BAUDCTRLB bit masks and bit positions */
6347
#define USART_BSCALE_gm 0xF0 /* Baud Rate Scale group mask. */
6348
#define USART_BSCALE_gp 4 /* Baud Rate Scale group position. */
6349
#define USART_BSCALE0_bm (1<<4) /* Baud Rate Scale bit 0 mask. */
6350
#define USART_BSCALE0_bp 4 /* Baud Rate Scale bit 0 position. */
6351
#define USART_BSCALE1_bm (1<<5) /* Baud Rate Scale bit 1 mask. */
6352
#define USART_BSCALE1_bp 5 /* Baud Rate Scale bit 1 position. */
6353
#define USART_BSCALE2_bm (1<<6) /* Baud Rate Scale bit 2 mask. */
6354
#define USART_BSCALE2_bp 6 /* Baud Rate Scale bit 2 position. */
6355
#define USART_BSCALE3_bm (1<<7) /* Baud Rate Scale bit 3 mask. */
6356
#define USART_BSCALE3_bp 7 /* Baud Rate Scale bit 3 position. */
6358
/* USART_BSEL_gm Predefined. */
6359
/* USART_BSEL_gp Predefined. */
6360
/* USART_BSEL0_bm Predefined. */
6361
/* USART_BSEL0_bp Predefined. */
6362
/* USART_BSEL1_bm Predefined. */
6363
/* USART_BSEL1_bp Predefined. */
6364
/* USART_BSEL2_bm Predefined. */
6365
/* USART_BSEL2_bp Predefined. */
6366
/* USART_BSEL3_bm Predefined. */
6367
/* USART_BSEL3_bp Predefined. */
6370
/* SPI - Serial Peripheral Interface */
6371
/* SPI.CTRL bit masks and bit positions */
6372
#define SPI_CLK2X_bm 0x80 /* Enable Double Speed bit mask. */
6373
#define SPI_CLK2X_bp 7 /* Enable Double Speed bit position. */
6375
#define SPI_ENABLE_bm 0x40 /* Enable Module bit mask. */
6376
#define SPI_ENABLE_bp 6 /* Enable Module bit position. */
6378
#define SPI_DORD_bm 0x20 /* Data Order Setting bit mask. */
6379
#define SPI_DORD_bp 5 /* Data Order Setting bit position. */
6381
#define SPI_MASTER_bm 0x10 /* Master Operation Enable bit mask. */
6382
#define SPI_MASTER_bp 4 /* Master Operation Enable bit position. */
6384
#define SPI_MODE_gm 0x0C /* SPI Mode group mask. */
6385
#define SPI_MODE_gp 2 /* SPI Mode group position. */
6386
#define SPI_MODE0_bm (1<<2) /* SPI Mode bit 0 mask. */
6387
#define SPI_MODE0_bp 2 /* SPI Mode bit 0 position. */
6388
#define SPI_MODE1_bm (1<<3) /* SPI Mode bit 1 mask. */
6389
#define SPI_MODE1_bp 3 /* SPI Mode bit 1 position. */
6391
#define SPI_PRESCALER_gm 0x03 /* Prescaler group mask. */
6392
#define SPI_PRESCALER_gp 0 /* Prescaler group position. */
6393
#define SPI_PRESCALER0_bm (1<<0) /* Prescaler bit 0 mask. */
6394
#define SPI_PRESCALER0_bp 0 /* Prescaler bit 0 position. */
6395
#define SPI_PRESCALER1_bm (1<<1) /* Prescaler bit 1 mask. */
6396
#define SPI_PRESCALER1_bp 1 /* Prescaler bit 1 position. */
6399
/* SPI.INTCTRL bit masks and bit positions */
6400
#define SPI_INTLVL_gm 0x03 /* Interrupt level group mask. */
6401
#define SPI_INTLVL_gp 0 /* Interrupt level group position. */
6402
#define SPI_INTLVL0_bm (1<<0) /* Interrupt level bit 0 mask. */
6403
#define SPI_INTLVL0_bp 0 /* Interrupt level bit 0 position. */
6404
#define SPI_INTLVL1_bm (1<<1) /* Interrupt level bit 1 mask. */
6405
#define SPI_INTLVL1_bp 1 /* Interrupt level bit 1 position. */
6408
/* SPI.STATUS bit masks and bit positions */
6409
#define SPI_IF_bm 0x80 /* Interrupt Flag bit mask. */
6410
#define SPI_IF_bp 7 /* Interrupt Flag bit position. */
6412
#define SPI_WRCOL_bm 0x40 /* Write Collision bit mask. */
6413
#define SPI_WRCOL_bp 6 /* Write Collision bit position. */
6416
/* IRCOM - IR Communication Module */
6417
/* IRCOM.CTRL bit masks and bit positions */
6418
#define IRCOM_EVSEL_gm 0x0F /* Event Channel Select group mask. */
6419
#define IRCOM_EVSEL_gp 0 /* Event Channel Select group position. */
6420
#define IRCOM_EVSEL0_bm (1<<0) /* Event Channel Select bit 0 mask. */
6421
#define IRCOM_EVSEL0_bp 0 /* Event Channel Select bit 0 position. */
6422
#define IRCOM_EVSEL1_bm (1<<1) /* Event Channel Select bit 1 mask. */
6423
#define IRCOM_EVSEL1_bp 1 /* Event Channel Select bit 1 position. */
6424
#define IRCOM_EVSEL2_bm (1<<2) /* Event Channel Select bit 2 mask. */
6425
#define IRCOM_EVSEL2_bp 2 /* Event Channel Select bit 2 position. */
6426
#define IRCOM_EVSEL3_bm (1<<3) /* Event Channel Select bit 3 mask. */
6427
#define IRCOM_EVSEL3_bp 3 /* Event Channel Select bit 3 position. */
6430
/* AES - AES Module */
6431
/* AES.CTRL bit masks and bit positions */
6432
#define AES_START_bm 0x80 /* Start/Run bit mask. */
6433
#define AES_START_bp 7 /* Start/Run bit position. */
6435
#define AES_AUTO_bm 0x40 /* Auto Start Trigger bit mask. */
6436
#define AES_AUTO_bp 6 /* Auto Start Trigger bit position. */
6438
#define AES_RESET_bm 0x20 /* AES Software Reset bit mask. */
6439
#define AES_RESET_bp 5 /* AES Software Reset bit position. */
6441
#define AES_DECRYPT_bm 0x10 /* Decryption / Direction bit mask. */
6442
#define AES_DECRYPT_bp 4 /* Decryption / Direction bit position. */
6444
#define AES_XOR_bm 0x04 /* State XOR Load Enable bit mask. */
6445
#define AES_XOR_bp 2 /* State XOR Load Enable bit position. */
6448
/* AES.STATUS bit masks and bit positions */
6449
#define AES_ERROR_bm 0x80 /* AES Error bit mask. */
6450
#define AES_ERROR_bp 7 /* AES Error bit position. */
6452
#define AES_SRIF_bm 0x01 /* State Ready Interrupt Flag bit mask. */
6453
#define AES_SRIF_bp 0 /* State Ready Interrupt Flag bit position. */
6456
/* AES.INTCTRL bit masks and bit positions */
6457
#define AES_INTLVL_gm 0x03 /* Interrupt level group mask. */
6458
#define AES_INTLVL_gp 0 /* Interrupt level group position. */
6459
#define AES_INTLVL0_bm (1<<0) /* Interrupt level bit 0 mask. */
6460
#define AES_INTLVL0_bp 0 /* Interrupt level bit 0 position. */
6461
#define AES_INTLVL1_bm (1<<1) /* Interrupt level bit 1 mask. */
6462
#define AES_INTLVL1_bp 1 /* Interrupt level bit 1 position. */
6466
// Generic Port Pins
6468
#define PIN0_bm 0x01
6470
#define PIN1_bm 0x02
6472
#define PIN2_bm 0x04
6474
#define PIN3_bm 0x08
6476
#define PIN4_bm 0x10
6478
#define PIN5_bm 0x20
6480
#define PIN6_bm 0x40
6482
#define PIN7_bm 0x80
6486
/* ========== Interrupt Vector Definitions ========== */
6487
/* Vector 0 is the reset vector */
6489
/* OSC interrupt vectors */
6490
#define OSC_XOSCF_vect_num 1
6491
#define OSC_XOSCF_vect _VECTOR(1) /* External Oscillator Failure Interrupt (NMI) */
6493
/* PORTC interrupt vectors */
6494
#define PORTC_INT0_vect_num 2
6495
#define PORTC_INT0_vect _VECTOR(2) /* External Interrupt 0 */
6496
#define PORTC_INT1_vect_num 3
6497
#define PORTC_INT1_vect _VECTOR(3) /* External Interrupt 1 */
6499
/* PORTR interrupt vectors */
6500
#define PORTR_INT0_vect_num 4
6501
#define PORTR_INT0_vect _VECTOR(4) /* External Interrupt 0 */
6502
#define PORTR_INT1_vect_num 5
6503
#define PORTR_INT1_vect _VECTOR(5) /* External Interrupt 1 */
6505
/* DMA interrupt vectors */
6506
#define DMA_CH0_vect_num 6
6507
#define DMA_CH0_vect _VECTOR(6) /* Channel 0 Interrupt */
6508
#define DMA_CH1_vect_num 7
6509
#define DMA_CH1_vect _VECTOR(7) /* Channel 1 Interrupt */
6510
#define DMA_CH2_vect_num 8
6511
#define DMA_CH2_vect _VECTOR(8) /* Channel 2 Interrupt */
6512
#define DMA_CH3_vect_num 9
6513
#define DMA_CH3_vect _VECTOR(9) /* Channel 3 Interrupt */
6515
/* RTC interrupt vectors */
6516
#define RTC_OVF_vect_num 10
6517
#define RTC_OVF_vect _VECTOR(10) /* Overflow Interrupt */
6518
#define RTC_COMP_vect_num 11
6519
#define RTC_COMP_vect _VECTOR(11) /* Compare Interrupt */
6521
/* TWIC interrupt vectors */
6522
#define TWIC_TWIS_vect_num 12
6523
#define TWIC_TWIS_vect _VECTOR(12) /* TWI Slave Interrupt */
6524
#define TWIC_TWIM_vect_num 13
6525
#define TWIC_TWIM_vect _VECTOR(13) /* TWI Master Interrupt */
6527
/* TCC0 interrupt vectors */
6528
#define TCC0_OVF_vect_num 14
6529
#define TCC0_OVF_vect _VECTOR(14) /* Overflow Interrupt */
6530
#define TCC0_ERR_vect_num 15
6531
#define TCC0_ERR_vect _VECTOR(15) /* Error Interrupt */
6532
#define TCC0_CCA_vect_num 16
6533
#define TCC0_CCA_vect _VECTOR(16) /* Compare or Capture A Interrupt */
6534
#define TCC0_CCB_vect_num 17
6535
#define TCC0_CCB_vect _VECTOR(17) /* Compare or Capture B Interrupt */
6536
#define TCC0_CCC_vect_num 18
6537
#define TCC0_CCC_vect _VECTOR(18) /* Compare or Capture C Interrupt */
6538
#define TCC0_CCD_vect_num 19
6539
#define TCC0_CCD_vect _VECTOR(19) /* Compare or Capture D Interrupt */
6541
/* TCC1 interrupt vectors */
6542
#define TCC1_OVF_vect_num 20
6543
#define TCC1_OVF_vect _VECTOR(20) /* Overflow Interrupt */
6544
#define TCC1_ERR_vect_num 21
6545
#define TCC1_ERR_vect _VECTOR(21) /* Error Interrupt */
6546
#define TCC1_CCA_vect_num 22
6547
#define TCC1_CCA_vect _VECTOR(22) /* Compare or Capture A Interrupt */
6548
#define TCC1_CCB_vect_num 23
6549
#define TCC1_CCB_vect _VECTOR(23) /* Compare or Capture B Interrupt */
6551
/* SPIC interrupt vectors */
6552
#define SPIC_INT_vect_num 24
6553
#define SPIC_INT_vect _VECTOR(24) /* SPI Interrupt */
6555
/* USARTC0 interrupt vectors */
6556
#define USARTC0_RXC_vect_num 25
6557
#define USARTC0_RXC_vect _VECTOR(25) /* Reception Complete Interrupt */
6558
#define USARTC0_DRE_vect_num 26
6559
#define USARTC0_DRE_vect _VECTOR(26) /* Data Register Empty Interrupt */
6560
#define USARTC0_TXC_vect_num 27
6561
#define USARTC0_TXC_vect _VECTOR(27) /* Transmission Complete Interrupt */
6563
/* USARTC1 interrupt vectors */
6564
#define USARTC1_RXC_vect_num 28
6565
#define USARTC1_RXC_vect _VECTOR(28) /* Reception Complete Interrupt */
6566
#define USARTC1_DRE_vect_num 29
6567
#define USARTC1_DRE_vect _VECTOR(29) /* Data Register Empty Interrupt */
6568
#define USARTC1_TXC_vect_num 30
6569
#define USARTC1_TXC_vect _VECTOR(30) /* Transmission Complete Interrupt */
6571
/* AES interrupt vectors */
6572
#define AES_INT_vect_num 31
6573
#define AES_INT_vect _VECTOR(31) /* AES Interrupt */
6575
/* NVM interrupt vectors */
6576
#define NVM_EE_vect_num 32
6577
#define NVM_EE_vect _VECTOR(32) /* EE Interrupt */
6578
#define NVM_SPM_vect_num 33
6579
#define NVM_SPM_vect _VECTOR(33) /* SPM Interrupt */
6581
/* PORTB interrupt vectors */
6582
#define PORTB_INT0_vect_num 34
6583
#define PORTB_INT0_vect _VECTOR(34) /* External Interrupt 0 */
6584
#define PORTB_INT1_vect_num 35
6585
#define PORTB_INT1_vect _VECTOR(35) /* External Interrupt 1 */
6587
/* ACB interrupt vectors */
6588
#define ACB_AC0_vect_num 36
6589
#define ACB_AC0_vect _VECTOR(36) /* AC0 Interrupt */
6590
#define ACB_AC1_vect_num 37
6591
#define ACB_AC1_vect _VECTOR(37) /* AC1 Interrupt */
6592
#define ACB_ACW_vect_num 38
6593
#define ACB_ACW_vect _VECTOR(38) /* ACW Window Mode Interrupt */
6595
/* ADCB interrupt vectors */
6596
#define ADCB_CH0_vect_num 39
6597
#define ADCB_CH0_vect _VECTOR(39) /* Interrupt 0 */
6598
#define ADCB_CH1_vect_num 40
6599
#define ADCB_CH1_vect _VECTOR(40) /* Interrupt 1 */
6600
#define ADCB_CH2_vect_num 41
6601
#define ADCB_CH2_vect _VECTOR(41) /* Interrupt 2 */
6602
#define ADCB_CH3_vect_num 42
6603
#define ADCB_CH3_vect _VECTOR(42) /* Interrupt 3 */
6605
/* PORTE interrupt vectors */
6606
#define PORTE_INT0_vect_num 43
6607
#define PORTE_INT0_vect _VECTOR(43) /* External Interrupt 0 */
6608
#define PORTE_INT1_vect_num 44
6609
#define PORTE_INT1_vect _VECTOR(44) /* External Interrupt 1 */
6611
/* TWIE interrupt vectors */
6612
#define TWIE_TWIS_vect_num 45
6613
#define TWIE_TWIS_vect _VECTOR(45) /* TWI Slave Interrupt */
6614
#define TWIE_TWIM_vect_num 46
6615
#define TWIE_TWIM_vect _VECTOR(46) /* TWI Master Interrupt */
6617
/* TCE0 interrupt vectors */
6618
#define TCE0_OVF_vect_num 47
6619
#define TCE0_OVF_vect _VECTOR(47) /* Overflow Interrupt */
6620
#define TCE0_ERR_vect_num 48
6621
#define TCE0_ERR_vect _VECTOR(48) /* Error Interrupt */
6622
#define TCE0_CCA_vect_num 49
6623
#define TCE0_CCA_vect _VECTOR(49) /* Compare or Capture A Interrupt */
6624
#define TCE0_CCB_vect_num 50
6625
#define TCE0_CCB_vect _VECTOR(50) /* Compare or Capture B Interrupt */
6626
#define TCE0_CCC_vect_num 51
6627
#define TCE0_CCC_vect _VECTOR(51) /* Compare or Capture C Interrupt */
6628
#define TCE0_CCD_vect_num 52
6629
#define TCE0_CCD_vect _VECTOR(52) /* Compare or Capture D Interrupt */
6631
/* TCE1 interrupt vectors */
6632
#define TCE1_OVF_vect_num 53
6633
#define TCE1_OVF_vect _VECTOR(53) /* Overflow Interrupt */
6634
#define TCE1_ERR_vect_num 54
6635
#define TCE1_ERR_vect _VECTOR(54) /* Error Interrupt */
6636
#define TCE1_CCA_vect_num 55
6637
#define TCE1_CCA_vect _VECTOR(55) /* Compare or Capture A Interrupt */
6638
#define TCE1_CCB_vect_num 56
6639
#define TCE1_CCB_vect _VECTOR(56) /* Compare or Capture B Interrupt */
6641
/* SPIE interrupt vectors */
6642
#define SPIE_INT_vect_num 57
6643
#define SPIE_INT_vect _VECTOR(57) /* SPI Interrupt */
6645
/* USARTE0 interrupt vectors */
6646
#define USARTE0_RXC_vect_num 58
6647
#define USARTE0_RXC_vect _VECTOR(58) /* Reception Complete Interrupt */
6648
#define USARTE0_DRE_vect_num 59
6649
#define USARTE0_DRE_vect _VECTOR(59) /* Data Register Empty Interrupt */
6650
#define USARTE0_TXC_vect_num 60
6651
#define USARTE0_TXC_vect _VECTOR(60) /* Transmission Complete Interrupt */
6653
/* USARTE1 interrupt vectors */
6654
#define USARTE1_RXC_vect_num 61
6655
#define USARTE1_RXC_vect _VECTOR(61) /* Reception Complete Interrupt */
6656
#define USARTE1_DRE_vect_num 62
6657
#define USARTE1_DRE_vect _VECTOR(62) /* Data Register Empty Interrupt */
6658
#define USARTE1_TXC_vect_num 63
6659
#define USARTE1_TXC_vect _VECTOR(63) /* Transmission Complete Interrupt */
6661
/* PORTD interrupt vectors */
6662
#define PORTD_INT0_vect_num 64
6663
#define PORTD_INT0_vect _VECTOR(64) /* External Interrupt 0 */
6664
#define PORTD_INT1_vect_num 65
6665
#define PORTD_INT1_vect _VECTOR(65) /* External Interrupt 1 */
6667
/* PORTA interrupt vectors */
6668
#define PORTA_INT0_vect_num 66
6669
#define PORTA_INT0_vect _VECTOR(66) /* External Interrupt 0 */
6670
#define PORTA_INT1_vect_num 67
6671
#define PORTA_INT1_vect _VECTOR(67) /* External Interrupt 1 */
6673
/* ACA interrupt vectors */
6674
#define ACA_AC0_vect_num 68
6675
#define ACA_AC0_vect _VECTOR(68) /* AC0 Interrupt */
6676
#define ACA_AC1_vect_num 69
6677
#define ACA_AC1_vect _VECTOR(69) /* AC1 Interrupt */
6678
#define ACA_ACW_vect_num 70
6679
#define ACA_ACW_vect _VECTOR(70) /* ACW Window Mode Interrupt */
6681
/* ADCA interrupt vectors */
6682
#define ADCA_CH0_vect_num 71
6683
#define ADCA_CH0_vect _VECTOR(71) /* Interrupt 0 */
6684
#define ADCA_CH1_vect_num 72
6685
#define ADCA_CH1_vect _VECTOR(72) /* Interrupt 1 */
6686
#define ADCA_CH2_vect_num 73
6687
#define ADCA_CH2_vect _VECTOR(73) /* Interrupt 2 */
6688
#define ADCA_CH3_vect_num 74
6689
#define ADCA_CH3_vect _VECTOR(74) /* Interrupt 3 */
6691
/* TCD0 interrupt vectors */
6692
#define TCD0_OVF_vect_num 77
6693
#define TCD0_OVF_vect _VECTOR(77) /* Overflow Interrupt */
6694
#define TCD0_ERR_vect_num 78
6695
#define TCD0_ERR_vect _VECTOR(78) /* Error Interrupt */
6696
#define TCD0_CCA_vect_num 79
6697
#define TCD0_CCA_vect _VECTOR(79) /* Compare or Capture A Interrupt */
6698
#define TCD0_CCB_vect_num 80
6699
#define TCD0_CCB_vect _VECTOR(80) /* Compare or Capture B Interrupt */
6700
#define TCD0_CCC_vect_num 81
6701
#define TCD0_CCC_vect _VECTOR(81) /* Compare or Capture C Interrupt */
6702
#define TCD0_CCD_vect_num 82
6703
#define TCD0_CCD_vect _VECTOR(82) /* Compare or Capture D Interrupt */
6705
/* TCD1 interrupt vectors */
6706
#define TCD1_OVF_vect_num 83
6707
#define TCD1_OVF_vect _VECTOR(83) /* Overflow Interrupt */
6708
#define TCD1_ERR_vect_num 84
6709
#define TCD1_ERR_vect _VECTOR(84) /* Error Interrupt */
6710
#define TCD1_CCA_vect_num 85
6711
#define TCD1_CCA_vect _VECTOR(85) /* Compare or Capture A Interrupt */
6712
#define TCD1_CCB_vect_num 86
6713
#define TCD1_CCB_vect _VECTOR(86) /* Compare or Capture B Interrupt */
6715
/* SPID interrupt vectors */
6716
#define SPID_INT_vect_num 87
6717
#define SPID_INT_vect _VECTOR(87) /* SPI Interrupt */
6719
/* USARTD0 interrupt vectors */
6720
#define USARTD0_RXC_vect_num 88
6721
#define USARTD0_RXC_vect _VECTOR(88) /* Reception Complete Interrupt */
6722
#define USARTD0_DRE_vect_num 89
6723
#define USARTD0_DRE_vect _VECTOR(89) /* Data Register Empty Interrupt */
6724
#define USARTD0_TXC_vect_num 90
6725
#define USARTD0_TXC_vect _VECTOR(90) /* Transmission Complete Interrupt */
6727
/* USARTD1 interrupt vectors */
6728
#define USARTD1_RXC_vect_num 91
6729
#define USARTD1_RXC_vect _VECTOR(91) /* Reception Complete Interrupt */
6730
#define USARTD1_DRE_vect_num 92
6731
#define USARTD1_DRE_vect _VECTOR(92) /* Data Register Empty Interrupt */
6732
#define USARTD1_TXC_vect_num 93
6733
#define USARTD1_TXC_vect _VECTOR(93) /* Transmission Complete Interrupt */
6735
/* PORTF interrupt vectors */
6736
#define PORTF_INT0_vect_num 104
6737
#define PORTF_INT0_vect _VECTOR(104) /* External Interrupt 0 */
6738
#define PORTF_INT1_vect_num 105
6739
#define PORTF_INT1_vect _VECTOR(105) /* External Interrupt 1 */
6741
/* TCF0 interrupt vectors */
6742
#define TCF0_OVF_vect_num 108
6743
#define TCF0_OVF_vect _VECTOR(108) /* Overflow Interrupt */
6744
#define TCF0_ERR_vect_num 109
6745
#define TCF0_ERR_vect _VECTOR(109) /* Error Interrupt */
6746
#define TCF0_CCA_vect_num 110
6747
#define TCF0_CCA_vect _VECTOR(110) /* Compare or Capture A Interrupt */
6748
#define TCF0_CCB_vect_num 111
6749
#define TCF0_CCB_vect _VECTOR(111) /* Compare or Capture B Interrupt */
6750
#define TCF0_CCC_vect_num 112
6751
#define TCF0_CCC_vect _VECTOR(112) /* Compare or Capture C Interrupt */
6752
#define TCF0_CCD_vect_num 113
6753
#define TCF0_CCD_vect _VECTOR(113) /* Compare or Capture D Interrupt */
6755
/* USARTF0 interrupt vectors */
6756
#define USARTF0_RXC_vect_num 119
6757
#define USARTF0_RXC_vect _VECTOR(119) /* Reception Complete Interrupt */
6758
#define USARTF0_DRE_vect_num 120
6759
#define USARTF0_DRE_vect _VECTOR(120) /* Data Register Empty Interrupt */
6760
#define USARTF0_TXC_vect_num 121
6761
#define USARTF0_TXC_vect _VECTOR(121) /* Transmission Complete Interrupt */
6764
#define _VECTOR_SIZE 4 /* Size of individual vector. */
6765
#define _VECTORS_SIZE (122 * _VECTOR_SIZE)
6768
/* ========== Constants ========== */
6770
#define PROGMEM_START (0x0000)
6771
#define PROGMEM_SIZE (204800)
6772
#define PROGMEM_PAGE_SIZE (512)
6773
#define PROGMEM_END (PROGMEM_START + PROGMEM_SIZE - 1)
6775
#define APP_SECTION_START (0x0000)
6776
#define APP_SECTION_SIZE (196608)
6777
#define APP_SECTION_PAGE_SIZE (512)
6778
#define APP_SECTION_END (APP_SECTION_START + APP_SECTION_SIZE - 1)
6780
#define APPTABLE_SECTION_START (0x2E000)
6781
#define APPTABLE_SECTION_SIZE (8192)
6782
#define APPTABLE_SECTION_PAGE_SIZE (512)
6783
#define APPTABLE_SECTION_END (APPTABLE_SECTION_START + APPTABLE_SECTION_SIZE - 1)
6785
#define BOOT_SECTION_START (0x30000)
6786
#define BOOT_SECTION_SIZE (8192)
6787
#define BOOT_SECTION_PAGE_SIZE (512)
6788
#define BOOT_SECTION_END (BOOT_SECTION_START + BOOT_SECTION_SIZE - 1)
6790
#define DATAMEM_START (0x0000)
6791
#define DATAMEM_SIZE (16777216)
6792
#define DATAMEM_PAGE_SIZE (0)
6793
#define DATAMEM_END (DATAMEM_START + DATAMEM_SIZE - 1)
6795
#define IO_START (0x0000)
6796
#define IO_SIZE (4096)
6797
#define IO_PAGE_SIZE (0)
6798
#define IO_END (IO_START + IO_SIZE - 1)
6800
#define MAPPED_EEPROM_START (0x1000)
6801
#define MAPPED_EEPROM_SIZE (2048)
6802
#define MAPPED_EEPROM_PAGE_SIZE (0)
6803
#define MAPPED_EEPROM_END (MAPPED_EEPROM_START + MAPPED_EEPROM_SIZE - 1)
6805
#define INTERNAL_SRAM_START (0x2000)
6806
#define INTERNAL_SRAM_SIZE (16384)
6807
#define INTERNAL_SRAM_PAGE_SIZE (0)
6808
#define INTERNAL_SRAM_END (INTERNAL_SRAM_START + INTERNAL_SRAM_SIZE - 1)
6810
#define EEPROM_START (0x0000)
6811
#define EEPROM_SIZE (2048)
6812
#define EEPROM_PAGE_SIZE (32)
6813
#define EEPROM_END (EEPROM_START + EEPROM_SIZE - 1)
6815
#define FUSE_START (0x0000)
6816
#define FUSE_SIZE (6)
6817
#define FUSE_PAGE_SIZE (0)
6818
#define FUSE_END (FUSE_START + FUSE_SIZE - 1)
6820
#define LOCKBIT_START (0x0000)
6821
#define LOCKBIT_SIZE (1)
6822
#define LOCKBIT_PAGE_SIZE (0)
6823
#define LOCKBIT_END (LOCKBIT_START + LOCKBIT_SIZE - 1)
6825
#define SIGNATURES_START (0x0000)
6826
#define SIGNATURES_SIZE (3)
6827
#define SIGNATURES_PAGE_SIZE (0)
6828
#define SIGNATURES_END (SIGNATURES_START + SIGNATURES_SIZE - 1)
6830
#define USER_SIGNATURES_START (0x0000)
6831
#define USER_SIGNATURES_SIZE (512)
6832
#define USER_SIGNATURES_PAGE_SIZE (0)
6833
#define USER_SIGNATURES_END (USER_SIGNATURES_START + USER_SIGNATURES_SIZE - 1)
6835
#define PROD_SIGNATURES_START (0x0000)
6836
#define PROD_SIGNATURES_SIZE (52)
6837
#define PROD_SIGNATURES_PAGE_SIZE (0)
6838
#define PROD_SIGNATURES_END (PROD_SIGNATURES_START + PROD_SIGNATURES_SIZE - 1)
6840
#define FLASHEND PROGMEM_END
6841
#define SPM_PAGESIZE PROGMEM_PAGE_SIZE
6842
#define RAMSTART INTERNAL_SRAM_START
6843
#define RAMSIZE INTERNAL_SRAM_SIZE
6844
#define RAMEND INTERNAL_SRAM_END
6845
#define XRAMSTART EXTERNAL_SRAM_START
6846
#define XRAMSIZE EXTERNAL_SRAM_SIZE
6847
#define XRAMEND INTERNAL_SRAM_END
6848
#define E2END EEPROM_END
6849
#define E2PAGESIZE EEPROM_PAGE_SIZE
6852
/* ========== Fuses ========== */
6853
#define FUSE_MEMORY_SIZE 6
6856
#define FUSE_JTAGUSERID0 (unsigned char)~_BV(0) /* JTAG User ID Bit 0 */
6857
#define FUSE_JTAGUSERID1 (unsigned char)~_BV(1) /* JTAG User ID Bit 1 */
6858
#define FUSE_JTAGUSERID2 (unsigned char)~_BV(2) /* JTAG User ID Bit 2 */
6859
#define FUSE_JTAGUSERID3 (unsigned char)~_BV(3) /* JTAG User ID Bit 3 */
6860
#define FUSE_JTAGUSERID4 (unsigned char)~_BV(4) /* JTAG User ID Bit 4 */
6861
#define FUSE_JTAGUSERID5 (unsigned char)~_BV(5) /* JTAG User ID Bit 5 */
6862
#define FUSE_JTAGUSERID6 (unsigned char)~_BV(6) /* JTAG User ID Bit 6 */
6863
#define FUSE_JTAGUSERID7 (unsigned char)~_BV(7) /* JTAG User ID Bit 7 */
6864
#define FUSE0_DEFAULT (0xFF)
6867
#define FUSE_WDP0 (unsigned char)~_BV(0) /* Watchdog Timeout Period Bit 0 */
6868
#define FUSE_WDP1 (unsigned char)~_BV(1) /* Watchdog Timeout Period Bit 1 */
6869
#define FUSE_WDP2 (unsigned char)~_BV(2) /* Watchdog Timeout Period Bit 2 */
6870
#define FUSE_WDP3 (unsigned char)~_BV(3) /* Watchdog Timeout Period Bit 3 */
6871
#define FUSE_WDWP0 (unsigned char)~_BV(4) /* Watchdog Window Timeout Period Bit 0 */
6872
#define FUSE_WDWP1 (unsigned char)~_BV(5) /* Watchdog Window Timeout Period Bit 1 */
6873
#define FUSE_WDWP2 (unsigned char)~_BV(6) /* Watchdog Window Timeout Period Bit 2 */
6874
#define FUSE_WDWP3 (unsigned char)~_BV(7) /* Watchdog Window Timeout Period Bit 3 */
6875
#define FUSE1_DEFAULT (0xFF)
6878
#define FUSE_BODPD0 (unsigned char)~_BV(0) /* BOD Operation in Power-Down Mode Bit 0 */
6879
#define FUSE_BODPD1 (unsigned char)~_BV(1) /* BOD Operation in Power-Down Mode Bit 1 */
6880
#define FUSE_BOOTRST (unsigned char)~_BV(6) /* Boot Loader Section Reset Vector */
6881
#define FUSE_DVSDON (unsigned char)~_BV(7) /* Spike Detector Enable */
6882
#define FUSE2_DEFAULT (0xFF)
6884
/* Fuse Byte 3 Reserved */
6887
#define FUSE_JTAGEN (unsigned char)~_BV(0) /* JTAG Interface Enable */
6888
#define FUSE_WDLOCK (unsigned char)~_BV(1) /* Watchdog Timer Lock */
6889
#define FUSE_SUT0 (unsigned char)~_BV(2) /* Start-up Time Bit 0 */
6890
#define FUSE_SUT1 (unsigned char)~_BV(3) /* Start-up Time Bit 1 */
6891
#define FUSE4_DEFAULT (0xFF)
6894
#define FUSE_BODLVL0 (unsigned char)~_BV(0) /* Brown Out Detection Voltage Level Bit 0 */
6895
#define FUSE_BODLVL1 (unsigned char)~_BV(1) /* Brown Out Detection Voltage Level Bit 1 */
6896
#define FUSE_BODLVL2 (unsigned char)~_BV(2) /* Brown Out Detection Voltage Level Bit 2 */
6897
#define FUSE_EESAVE (unsigned char)~_BV(3) /* Preserve EEPROM Through Chip Erase */
6898
#define FUSE_BODACT0 (unsigned char)~_BV(4) /* BOD Operation in Active Mode Bit 0 */
6899
#define FUSE_BODACT1 (unsigned char)~_BV(5) /* BOD Operation in Active Mode Bit 1 */
6900
#define FUSE5_DEFAULT (0xFF)
6903
/* ========== Lock Bits ========== */
6904
#define __LOCK_BITS_EXIST
6905
#define __BOOT_LOCK_APPLICATION_TABLE_BITS_EXIST
6906
#define __BOOT_LOCK_APPLICATION_BITS_EXIST
6907
#define __BOOT_LOCK_BOOT_BITS_EXIST
6910
/* ========== Signature ========== */
6911
#define SIGNATURE_0 0x1E
6912
#define SIGNATURE_1 0x97
6913
#define SIGNATURE_2 0x44
6916
#endif /* _AVR_ATxmega192A3_H_ */