@@ -62,6 +62,17 @@ PORT[A-Z]:
6262 IN :
6363 name : INPUT
6464
65+ DIR :
66+ " P* " :
67+ # Make all Pins use the same enum
68+ _replace_enum :
69+ Input : [0, "Input"]
70+ Output : [1, "Output"]
71+
72+ # make PINxCTRL a rust slice
73+ _array :
74+ " PIN?CTRL " : {}
75+
6576SPI* :
6677 CTRLA :
6778 PRESC :
@@ -74,3 +85,107 @@ SPI*:
7485 [2, "Peripheral clock / 64 if CLK2X == 0 else Peripheral clock / 32"]
7586 CLK_PER_128_64 :
7687 [3, "Peripheral clock / 128 if CLK2X == 0 else Peripheral clock / 64"]
88+
89+ DORD :
90+ # Make it an enum
91+ _replace_enum :
92+ MsbFirst : [0, "Most significant byte first"]
93+ LsbFirst : [1, "Least significant byte first"]
94+
95+ " USART* " :
96+ STATUS :
97+ _modify :
98+ # The RXSIF bit is actually writable to clear the flag
99+ RXSIF :
100+ access : read-write
101+ # The WFB bit is write-only
102+ WFB :
103+ access : write-only
104+
105+ CPUINT :
106+ CTRLA :
107+ IVSEL :
108+ _replace_enum :
109+ AFTERBOOT : [0, "Interrupt vectors are placed after the BOOT section of the Flash"]
110+ INBOOT : [1, "Interrupt vectors are placed at the start of the BOOT section of the Flash"]
111+ CVT :
112+ _replace_enum :
113+ NORMAL : [0, "Compact Vector Table function is disabled"]
114+ COMPACT : [1, "Compact Vector Table function is enabled"]
115+ LVL0RR :
116+ _replace_enum :
117+ FIXED : [0, "Priority is fixed for priority level 0 interrupt requests: The lowest interrupt vector address has the highest priority."]
118+ ROUNDROBIN : [1, "The round robin priority scheme is enabled for priority level 0 interrupt requests"]
119+
120+ CCL :
121+ _cluster :
122+ " LUT%s " :
123+ description : " CCL LUT configuration cluster"
124+ " LUT?CTRLA " : {}
125+ " LUT?CTRLB " : {}
126+ " LUT?CTRLC " : {}
127+ " TRUTH? " : {}
128+
129+ # turn all SEQCTRL-registers into slices
130+ _array :
131+ " SEQCTRL? " : {}
132+
133+ EVSYS :
134+ # make ASYNCCHx, SYNCCHx, ASYNCUSERx and SYNCUSERx a rust slice
135+ _modify :
136+ " ASYNCUSER* " :
137+ description : " Users of asynchronous channels"
138+ " SYNCUSER* " :
139+ description : " Users of synchronous channels"
140+ _array :
141+ " ASYNCCH* " : {}
142+ " SYNCCH* " : {}
143+ " ASYNCUSER* " : {}
144+ " SYNCUSER* " : {}
145+
146+ TCB* :
147+ _add :
148+ # FIXME: no idea how to add a write constraint with range [0x0, 0xFF] to
149+ # added registers to prevent bits() from being marked as unsafe
150+ CCMPL :
151+ description : Lower Compare or Capture in 8-bit PWM mode
152+ addressOffset : 0x0C
153+ access : read-write
154+ size : 8
155+ CCMPH :
156+ description : Upper Compare or Capture in 8-bit PWM mode
157+ addressOffset : 0x0D
158+ access : read-write
159+ size : 8
160+
161+ CRCSCAN :
162+ CTRLB :
163+ SRC :
164+ _replace_enum :
165+ FLASH : [0, "CRC on entire flash"]
166+ BOOTAPP : [1, "CRC on boot and appl section of flash"]
167+ BOOT : [2, "CRC on boot section of flash"]
168+ MODE :
169+ _replace_enum :
170+ PRIORITY : [0, "Priority to flash"]
171+
172+ NVMCTRL :
173+ CTRLA :
174+ CMD :
175+ _replace_enum :
176+ NONE : [0, "No command"]
177+ WP : [1, "Write page"]
178+ ER : [2, "Erase page"]
179+ ERWP : [3, "Erase and write page"]
180+ PBC : [4, "Page buffer clear"]
181+ CHER : [5, "Chip erase"]
182+ EEER : [6, "EEPROM erase"]
183+ WFU : [7, "Write fuse (PDI only)"]
184+
185+ SLPCTRL :
186+ CTRLA :
187+ SMODE :
188+ _replace_enum :
189+ IDLE : [0, "Idle mode"]
190+ STANDBY : [1, "Standby Mode"]
191+ PDOWN : [2, "Power-down Mode"]
0 commit comments