diff options
Diffstat (limited to 'crates')
39 files changed, 1061 insertions, 4589 deletions
diff --git a/crates/assists/src/tests.rs b/crates/assists/src/tests.rs index 32bd8698b..b27f6bf75 100644 --- a/crates/assists/src/tests.rs +++ b/crates/assists/src/tests.rs | |||
@@ -49,14 +49,17 @@ pub(crate) fn check_assist_by_label( | |||
49 | // FIXME: instead of having a separate function here, maybe use | 49 | // FIXME: instead of having a separate function here, maybe use |
50 | // `extract_ranges` and mark the target as `<target> </target>` in the | 50 | // `extract_ranges` and mark the target as `<target> </target>` in the |
51 | // fixture? | 51 | // fixture? |
52 | #[track_caller] | ||
52 | pub(crate) fn check_assist_target(assist: Handler, ra_fixture: &str, target: &str) { | 53 | pub(crate) fn check_assist_target(assist: Handler, ra_fixture: &str, target: &str) { |
53 | check(assist, ra_fixture, ExpectedResult::Target(target), None); | 54 | check(assist, ra_fixture, ExpectedResult::Target(target), None); |
54 | } | 55 | } |
55 | 56 | ||
57 | #[track_caller] | ||
56 | pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) { | 58 | pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) { |
57 | check(assist, ra_fixture, ExpectedResult::NotApplicable, None); | 59 | check(assist, ra_fixture, ExpectedResult::NotApplicable, None); |
58 | } | 60 | } |
59 | 61 | ||
62 | #[track_caller] | ||
60 | fn check_doc_test(assist_id: &str, before: &str, after: &str) { | 63 | fn check_doc_test(assist_id: &str, before: &str, after: &str) { |
61 | let after = trim_indent(after); | 64 | let after = trim_indent(after); |
62 | let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before); | 65 | let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before); |
@@ -95,6 +98,7 @@ enum ExpectedResult<'a> { | |||
95 | Target(&'a str), | 98 | Target(&'a str), |
96 | } | 99 | } |
97 | 100 | ||
101 | #[track_caller] | ||
98 | fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: Option<&str>) { | 102 | fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: Option<&str>) { |
99 | let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before); | 103 | let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before); |
100 | let text_without_caret = db.file_text(file_with_caret_id).to_string(); | 104 | let text_without_caret = db.file_text(file_with_caret_id).to_string(); |
diff --git a/crates/completion/src/completions.rs b/crates/completion/src/completions.rs index c3ce6e51d..3b582ed07 100644 --- a/crates/completion/src/completions.rs +++ b/crates/completion/src/completions.rs | |||
@@ -15,7 +15,9 @@ pub(crate) mod trait_impl; | |||
15 | pub(crate) mod mod_; | 15 | pub(crate) mod mod_; |
16 | pub(crate) mod flyimport; | 16 | pub(crate) mod flyimport; |
17 | 17 | ||
18 | use hir::{ModPath, ScopeDef, Type}; | 18 | use std::iter; |
19 | |||
20 | use hir::{known, ModPath, ScopeDef, Type}; | ||
19 | 21 | ||
20 | use crate::{ | 22 | use crate::{ |
21 | item::Builder, | 23 | item::Builder, |
@@ -118,7 +120,18 @@ impl Completions { | |||
118 | variant: hir::Variant, | 120 | variant: hir::Variant, |
119 | local_name: Option<hir::Name>, | 121 | local_name: Option<hir::Name>, |
120 | ) { | 122 | ) { |
121 | if let Some(item) = render_variant_pat(RenderContext::new(ctx), variant, local_name) { | 123 | if let Some(item) = render_variant_pat(RenderContext::new(ctx), variant, local_name, None) { |
124 | self.add(item); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | pub(crate) fn add_qualified_variant_pat( | ||
129 | &mut self, | ||
130 | ctx: &CompletionContext, | ||
131 | variant: hir::Variant, | ||
132 | path: ModPath, | ||
133 | ) { | ||
134 | if let Some(item) = render_variant_pat(RenderContext::new(ctx), variant, None, Some(path)) { | ||
122 | self.add(item); | 135 | self.add(item); |
123 | } | 136 | } |
124 | } | 137 | } |
@@ -166,3 +179,46 @@ impl Completions { | |||
166 | self.add(item); | 179 | self.add(item); |
167 | } | 180 | } |
168 | } | 181 | } |
182 | |||
183 | fn complete_enum_variants( | ||
184 | acc: &mut Completions, | ||
185 | ctx: &CompletionContext, | ||
186 | ty: &hir::Type, | ||
187 | cb: impl Fn(&mut Completions, &CompletionContext, hir::Variant, hir::ModPath), | ||
188 | ) { | ||
189 | if let Some(hir::Adt::Enum(enum_data)) = | ||
190 | iter::successors(Some(ty.clone()), |ty| ty.remove_ref()).last().and_then(|ty| ty.as_adt()) | ||
191 | { | ||
192 | let variants = enum_data.variants(ctx.db); | ||
193 | |||
194 | let module = if let Some(module) = ctx.scope.module() { | ||
195 | // Compute path from the completion site if available. | ||
196 | module | ||
197 | } else { | ||
198 | // Otherwise fall back to the enum's definition site. | ||
199 | enum_data.module(ctx.db) | ||
200 | }; | ||
201 | |||
202 | if let Some(impl_) = ctx.impl_def.as_ref().and_then(|impl_| ctx.sema.to_def(impl_)) { | ||
203 | if impl_.target_ty(ctx.db) == *ty { | ||
204 | for &variant in &variants { | ||
205 | let self_path = hir::ModPath::from_segments( | ||
206 | hir::PathKind::Plain, | ||
207 | iter::once(known::SELF_TYPE).chain(iter::once(variant.name(ctx.db))), | ||
208 | ); | ||
209 | cb(acc, ctx, variant, self_path); | ||
210 | } | ||
211 | } | ||
212 | } | ||
213 | |||
214 | for variant in variants { | ||
215 | if let Some(path) = module.find_use_path(ctx.db, hir::ModuleDef::from(variant)) { | ||
216 | // Variants with trivial paths are already added by the existing completion logic, | ||
217 | // so we should avoid adding these twice | ||
218 | if path.segments().len() > 1 { | ||
219 | cb(acc, ctx, variant, path); | ||
220 | } | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | } | ||
diff --git a/crates/completion/src/completions/keyword.rs b/crates/completion/src/completions/keyword.rs index 47e146128..eb81f9765 100644 --- a/crates/completion/src/completions/keyword.rs +++ b/crates/completion/src/completions/keyword.rs | |||
@@ -88,6 +88,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
88 | add_keyword(ctx, acc, "loop", "loop {$0}"); | 88 | add_keyword(ctx, acc, "loop", "loop {$0}"); |
89 | add_keyword(ctx, acc, "if", "if $0 {}"); | 89 | add_keyword(ctx, acc, "if", "if $0 {}"); |
90 | add_keyword(ctx, acc, "if let", "if let $1 = $0 {}"); | 90 | add_keyword(ctx, acc, "if let", "if let $1 = $0 {}"); |
91 | add_keyword(ctx, acc, "for", "for $1 in $0 {}"); | ||
91 | } | 92 | } |
92 | 93 | ||
93 | if ctx.if_is_prev || ctx.block_expr_parent { | 94 | if ctx.if_is_prev || ctx.block_expr_parent { |
@@ -258,6 +259,7 @@ mod tests { | |||
258 | kw loop | 259 | kw loop |
259 | kw if | 260 | kw if |
260 | kw if let | 261 | kw if let |
262 | kw for | ||
261 | kw let | 263 | kw let |
262 | kw mod | 264 | kw mod |
263 | kw const | 265 | kw const |
@@ -284,6 +286,7 @@ mod tests { | |||
284 | kw loop | 286 | kw loop |
285 | kw if | 287 | kw if |
286 | kw if let | 288 | kw if let |
289 | kw for | ||
287 | kw let | 290 | kw let |
288 | kw mod | 291 | kw mod |
289 | kw const | 292 | kw const |
@@ -310,6 +313,7 @@ mod tests { | |||
310 | kw loop | 313 | kw loop |
311 | kw if | 314 | kw if |
312 | kw if let | 315 | kw if let |
316 | kw for | ||
313 | kw let | 317 | kw let |
314 | kw else | 318 | kw else |
315 | kw else if | 319 | kw else if |
@@ -343,6 +347,7 @@ fn quux() -> i32 { | |||
343 | kw loop | 347 | kw loop |
344 | kw if | 348 | kw if |
345 | kw if let | 349 | kw if let |
350 | kw for | ||
346 | kw unsafe | 351 | kw unsafe |
347 | kw return | 352 | kw return |
348 | "#]], | 353 | "#]], |
@@ -391,6 +396,7 @@ fn quux() -> i32 { | |||
391 | kw loop | 396 | kw loop |
392 | kw if | 397 | kw if |
393 | kw if let | 398 | kw if let |
399 | kw for | ||
394 | kw let | 400 | kw let |
395 | kw mod | 401 | kw mod |
396 | kw const | 402 | kw const |
@@ -549,6 +555,7 @@ pub mod future { | |||
549 | kw loop | 555 | kw loop |
550 | kw if | 556 | kw if |
551 | kw if let | 557 | kw if let |
558 | kw for | ||
552 | kw return | 559 | kw return |
553 | "#]], | 560 | "#]], |
554 | ) | 561 | ) |
@@ -607,6 +614,7 @@ fn foo() { | |||
607 | kw loop | 614 | kw loop |
608 | kw if | 615 | kw if |
609 | kw if let | 616 | kw if let |
617 | kw for | ||
610 | kw return | 618 | kw return |
611 | "#]], | 619 | "#]], |
612 | ); | 620 | ); |
diff --git a/crates/completion/src/completions/pattern.rs b/crates/completion/src/completions/pattern.rs index 595160ff5..9282c3827 100644 --- a/crates/completion/src/completions/pattern.rs +++ b/crates/completion/src/completions/pattern.rs | |||
@@ -11,6 +11,12 @@ pub(crate) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) { | |||
11 | return; | 11 | return; |
12 | } | 12 | } |
13 | 13 | ||
14 | if let Some(ty) = &ctx.expected_type { | ||
15 | super::complete_enum_variants(acc, ctx, ty, |acc, ctx, variant, path| { | ||
16 | acc.add_qualified_variant_pat(ctx, variant, path) | ||
17 | }); | ||
18 | } | ||
19 | |||
14 | // FIXME: ideally, we should look at the type we are matching against and | 20 | // FIXME: ideally, we should look at the type we are matching against and |
15 | // suggest variants + auto-imports | 21 | // suggest variants + auto-imports |
16 | ctx.scope.process_all_names(&mut |name, res| { | 22 | ctx.scope.process_all_names(&mut |name, res| { |
@@ -31,6 +37,14 @@ pub(crate) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) { | |||
31 | _ => false, | 37 | _ => false, |
32 | }, | 38 | }, |
33 | hir::ScopeDef::MacroDef(_) => true, | 39 | hir::ScopeDef::MacroDef(_) => true, |
40 | hir::ScopeDef::ImplSelfType(impl_) => match impl_.target_ty(ctx.db).as_adt() { | ||
41 | Some(hir::Adt::Struct(strukt)) => { | ||
42 | acc.add_struct_pat(ctx, strukt, Some(name.clone())); | ||
43 | true | ||
44 | } | ||
45 | Some(hir::Adt::Enum(_)) => !ctx.is_irrefutable_pat_binding, | ||
46 | _ => true, | ||
47 | }, | ||
34 | _ => false, | 48 | _ => false, |
35 | }; | 49 | }; |
36 | if add_resolution { | 50 | if add_resolution { |
@@ -258,4 +272,46 @@ fn main() { | |||
258 | "#, | 272 | "#, |
259 | ); | 273 | ); |
260 | } | 274 | } |
275 | |||
276 | #[test] | ||
277 | fn completes_self_pats() { | ||
278 | check_snippet( | ||
279 | r#" | ||
280 | struct Foo(i32); | ||
281 | impl Foo { | ||
282 | fn foo() { | ||
283 | match () { | ||
284 | $0 | ||
285 | } | ||
286 | } | ||
287 | } | ||
288 | "#, | ||
289 | expect![[r#" | ||
290 | bn Self Self($1)$0 | ||
291 | bn Foo Foo($1)$0 | ||
292 | "#]], | ||
293 | ) | ||
294 | } | ||
295 | |||
296 | #[test] | ||
297 | fn completes_qualified_variant() { | ||
298 | check_snippet( | ||
299 | r#" | ||
300 | enum Foo { | ||
301 | Bar { baz: i32 } | ||
302 | } | ||
303 | impl Foo { | ||
304 | fn foo() { | ||
305 | match {Foo::Bar { baz: 0 }} { | ||
306 | B$0 | ||
307 | } | ||
308 | } | ||
309 | } | ||
310 | "#, | ||
311 | expect![[r#" | ||
312 | bn Self::Bar Self::Bar { baz$1 }$0 | ||
313 | bn Foo::Bar Foo::Bar { baz$1 }$0 | ||
314 | "#]], | ||
315 | ) | ||
316 | } | ||
261 | } | 317 | } |
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index e2482f959..e9d0ff665 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -1,8 +1,6 @@ | |||
1 | //! Completion of names from the current scope, e.g. locals and imported items. | 1 | //! Completion of names from the current scope, e.g. locals and imported items. |
2 | 2 | ||
3 | use std::iter; | 3 | use hir::ScopeDef; |
4 | |||
5 | use hir::{Adt, ModuleDef, ScopeDef, Type}; | ||
6 | use syntax::AstNode; | 4 | use syntax::AstNode; |
7 | use test_utils::mark; | 5 | use test_utils::mark; |
8 | 6 | ||
@@ -21,7 +19,9 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
21 | } | 19 | } |
22 | 20 | ||
23 | if let Some(ty) = &ctx.expected_type { | 21 | if let Some(ty) = &ctx.expected_type { |
24 | complete_enum_variants(acc, ctx, ty); | 22 | super::complete_enum_variants(acc, ctx, ty, |acc, ctx, variant, path| { |
23 | acc.add_qualified_enum_variant(ctx, variant, path) | ||
24 | }); | ||
25 | } | 25 | } |
26 | 26 | ||
27 | if ctx.is_pat_binding_or_const { | 27 | if ctx.is_pat_binding_or_const { |
@@ -45,32 +45,6 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
45 | }); | 45 | }); |
46 | } | 46 | } |
47 | 47 | ||
48 | fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &Type) { | ||
49 | if let Some(Adt::Enum(enum_data)) = | ||
50 | iter::successors(Some(ty.clone()), |ty| ty.remove_ref()).last().and_then(|ty| ty.as_adt()) | ||
51 | { | ||
52 | let variants = enum_data.variants(ctx.db); | ||
53 | |||
54 | let module = if let Some(module) = ctx.scope.module() { | ||
55 | // Compute path from the completion site if available. | ||
56 | module | ||
57 | } else { | ||
58 | // Otherwise fall back to the enum's definition site. | ||
59 | enum_data.module(ctx.db) | ||
60 | }; | ||
61 | |||
62 | for variant in variants { | ||
63 | if let Some(path) = module.find_use_path(ctx.db, ModuleDef::from(variant)) { | ||
64 | // Variants with trivial paths are already added by the existing completion logic, | ||
65 | // so we should avoid adding these twice | ||
66 | if path.segments().len() > 1 { | ||
67 | acc.add_qualified_enum_variant(ctx, variant, path); | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | |||
74 | #[cfg(test)] | 48 | #[cfg(test)] |
75 | mod tests { | 49 | mod tests { |
76 | use expect_test::{expect, Expect}; | 50 | use expect_test::{expect, Expect}; |
@@ -729,6 +703,28 @@ fn f() -> m::E { V$0 } | |||
729 | } | 703 | } |
730 | 704 | ||
731 | #[test] | 705 | #[test] |
706 | fn completes_enum_variant_impl() { | ||
707 | check( | ||
708 | r#" | ||
709 | enum Foo { Bar, Baz, Quux } | ||
710 | impl Foo { | ||
711 | fn foo() { match Foo::Bar { Q$0 } } | ||
712 | } | ||
713 | "#, | ||
714 | expect![[r#" | ||
715 | ev Self::Bar () | ||
716 | ev Self::Baz () | ||
717 | ev Self::Quux () | ||
718 | ev Foo::Bar () | ||
719 | ev Foo::Baz () | ||
720 | ev Foo::Quux () | ||
721 | sp Self | ||
722 | en Foo | ||
723 | "#]], | ||
724 | ) | ||
725 | } | ||
726 | |||
727 | #[test] | ||
732 | fn dont_complete_attr() { | 728 | fn dont_complete_attr() { |
733 | check( | 729 | check( |
734 | r#" | 730 | r#" |
diff --git a/crates/completion/src/context.rs b/crates/completion/src/context.rs index b1e8eba85..3db357855 100644 --- a/crates/completion/src/context.rs +++ b/crates/completion/src/context.rs | |||
@@ -276,6 +276,14 @@ impl<'a> CompletionContext<'a> { | |||
276 | }); | 276 | }); |
277 | } | 277 | } |
278 | 278 | ||
279 | fn fill_impl_def(&mut self) { | ||
280 | self.impl_def = self | ||
281 | .sema | ||
282 | .ancestors_with_macros(self.token.parent()) | ||
283 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | ||
284 | .find_map(ast::Impl::cast); | ||
285 | } | ||
286 | |||
279 | fn fill( | 287 | fn fill( |
280 | &mut self, | 288 | &mut self, |
281 | original_file: &SyntaxNode, | 289 | original_file: &SyntaxNode, |
@@ -345,6 +353,8 @@ impl<'a> CompletionContext<'a> { | |||
345 | self.is_irrefutable_pat_binding = true; | 353 | self.is_irrefutable_pat_binding = true; |
346 | } | 354 | } |
347 | } | 355 | } |
356 | |||
357 | self.fill_impl_def(); | ||
348 | } | 358 | } |
349 | if is_node::<ast::Param>(name.syntax()) { | 359 | if is_node::<ast::Param>(name.syntax()) { |
350 | self.is_param = true; | 360 | self.is_param = true; |
@@ -372,11 +382,7 @@ impl<'a> CompletionContext<'a> { | |||
372 | self.sema.find_node_at_offset_with_macros(&original_file, offset); | 382 | self.sema.find_node_at_offset_with_macros(&original_file, offset); |
373 | } | 383 | } |
374 | 384 | ||
375 | self.impl_def = self | 385 | self.fill_impl_def(); |
376 | .sema | ||
377 | .ancestors_with_macros(self.token.parent()) | ||
378 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | ||
379 | .find_map(ast::Impl::cast); | ||
380 | 386 | ||
381 | let top_node = name_ref | 387 | let top_node = name_ref |
382 | .syntax() | 388 | .syntax() |
diff --git a/crates/completion/src/render/pattern.rs b/crates/completion/src/render/pattern.rs index 61d8a17e5..465dfe00c 100644 --- a/crates/completion/src/render/pattern.rs +++ b/crates/completion/src/render/pattern.rs | |||
@@ -49,13 +49,17 @@ pub(crate) fn render_variant_pat( | |||
49 | ctx: RenderContext<'_>, | 49 | ctx: RenderContext<'_>, |
50 | variant: hir::Variant, | 50 | variant: hir::Variant, |
51 | local_name: Option<Name>, | 51 | local_name: Option<Name>, |
52 | path: Option<hir::ModPath>, | ||
52 | ) -> Option<CompletionItem> { | 53 | ) -> Option<CompletionItem> { |
53 | let _p = profile::span("render_variant_pat"); | 54 | let _p = profile::span("render_variant_pat"); |
54 | 55 | ||
55 | let fields = variant.fields(ctx.db()); | 56 | let fields = variant.fields(ctx.db()); |
56 | let (visible_fields, fields_omitted) = visible_fields(&ctx, &fields, variant)?; | 57 | let (visible_fields, fields_omitted) = visible_fields(&ctx, &fields, variant)?; |
57 | 58 | ||
58 | let name = local_name.unwrap_or_else(|| variant.name(ctx.db())).to_string(); | 59 | let name = match &path { |
60 | Some(path) => path.to_string(), | ||
61 | None => local_name.unwrap_or_else(|| variant.name(ctx.db())).to_string(), | ||
62 | }; | ||
59 | let pat = render_pat(&ctx, &name, variant.kind(ctx.db()), &visible_fields, fields_omitted)?; | 63 | let pat = render_pat(&ctx, &name, variant.kind(ctx.db()), &visible_fields, fields_omitted)?; |
60 | 64 | ||
61 | Some(build_completion(ctx, name, pat, variant)) | 65 | Some(build_completion(ctx, name, pat, variant)) |
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 626c3078a..bed3fa50f 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -222,8 +222,9 @@ impl SourceAnalyzer { | |||
222 | db: &dyn HirDatabase, | 222 | db: &dyn HirDatabase, |
223 | path: &ast::Path, | 223 | path: &ast::Path, |
224 | ) -> Option<PathResolution> { | 224 | ) -> Option<PathResolution> { |
225 | let parent = || path.syntax().parent(); | ||
225 | let mut prefer_value_ns = false; | 226 | let mut prefer_value_ns = false; |
226 | if let Some(path_expr) = path.syntax().parent().and_then(ast::PathExpr::cast) { | 227 | if let Some(path_expr) = parent().and_then(ast::PathExpr::cast) { |
227 | let expr_id = self.expr_id(db, &path_expr.into())?; | 228 | let expr_id = self.expr_id(db, &path_expr.into())?; |
228 | let infer = self.infer.as_ref()?; | 229 | let infer = self.infer.as_ref()?; |
229 | if let Some(assoc) = infer.assoc_resolutions_for_expr(expr_id) { | 230 | if let Some(assoc) = infer.assoc_resolutions_for_expr(expr_id) { |
@@ -237,7 +238,7 @@ impl SourceAnalyzer { | |||
237 | prefer_value_ns = true; | 238 | prefer_value_ns = true; |
238 | } | 239 | } |
239 | 240 | ||
240 | if let Some(path_pat) = path.syntax().parent().and_then(ast::PathPat::cast) { | 241 | if let Some(path_pat) = parent().and_then(ast::PathPat::cast) { |
241 | let pat_id = self.pat_id(&path_pat.into())?; | 242 | let pat_id = self.pat_id(&path_pat.into())?; |
242 | if let Some(assoc) = self.infer.as_ref()?.assoc_resolutions_for_pat(pat_id) { | 243 | if let Some(assoc) = self.infer.as_ref()?.assoc_resolutions_for_pat(pat_id) { |
243 | return Some(PathResolution::AssocItem(assoc.into())); | 244 | return Some(PathResolution::AssocItem(assoc.into())); |
@@ -249,7 +250,7 @@ impl SourceAnalyzer { | |||
249 | } | 250 | } |
250 | } | 251 | } |
251 | 252 | ||
252 | if let Some(rec_lit) = path.syntax().parent().and_then(ast::RecordExpr::cast) { | 253 | if let Some(rec_lit) = parent().and_then(ast::RecordExpr::cast) { |
253 | let expr_id = self.expr_id(db, &rec_lit.into())?; | 254 | let expr_id = self.expr_id(db, &rec_lit.into())?; |
254 | if let Some(VariantId::EnumVariantId(variant)) = | 255 | if let Some(VariantId::EnumVariantId(variant)) = |
255 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) | 256 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) |
@@ -258,8 +259,12 @@ impl SourceAnalyzer { | |||
258 | } | 259 | } |
259 | } | 260 | } |
260 | 261 | ||
261 | if let Some(rec_pat) = path.syntax().parent().and_then(ast::RecordPat::cast) { | 262 | if let Some(pat) = parent() |
262 | let pat_id = self.pat_id(&rec_pat.into())?; | 263 | .and_then(ast::RecordPat::cast) |
264 | .map(ast::Pat::from) | ||
265 | .or_else(|| parent().and_then(ast::TupleStructPat::cast).map(ast::Pat::from)) | ||
266 | { | ||
267 | let pat_id = self.pat_id(&pat)?; | ||
263 | if let Some(VariantId::EnumVariantId(variant)) = | 268 | if let Some(VariantId::EnumVariantId(variant)) = |
264 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) | 269 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) |
265 | { | 270 | { |
@@ -272,7 +277,7 @@ impl SourceAnalyzer { | |||
272 | 277 | ||
273 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we | 278 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we |
274 | // trying to resolve foo::bar. | 279 | // trying to resolve foo::bar. |
275 | if let Some(outer_path) = path.syntax().parent().and_then(ast::Path::cast) { | 280 | if let Some(outer_path) = parent().and_then(ast::Path::cast) { |
276 | if let Some(qualifier) = outer_path.qualifier() { | 281 | if let Some(qualifier) = outer_path.qualifier() { |
277 | if path == &qualifier { | 282 | if path == &qualifier { |
278 | return resolve_hir_path_qualifier(db, &self.resolver, &hir_path); | 283 | return resolve_hir_path_qualifier(db, &self.resolver, &hir_path); |
diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index 49f1427b4..210b4a617 100644 --- a/crates/hir_def/src/body/scope.rs +++ b/crates/hir_def/src/body/scope.rs | |||
@@ -9,7 +9,7 @@ use crate::{ | |||
9 | body::Body, | 9 | body::Body, |
10 | db::DefDatabase, | 10 | db::DefDatabase, |
11 | expr::{Expr, ExprId, Pat, PatId, Statement}, | 11 | expr::{Expr, ExprId, Pat, PatId, Statement}, |
12 | DefWithBodyId, | 12 | BlockId, DefWithBodyId, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | pub type ScopeId = Idx<ScopeData>; | 15 | pub type ScopeId = Idx<ScopeData>; |
@@ -39,6 +39,7 @@ impl ScopeEntry { | |||
39 | #[derive(Debug, PartialEq, Eq)] | 39 | #[derive(Debug, PartialEq, Eq)] |
40 | pub struct ScopeData { | 40 | pub struct ScopeData { |
41 | parent: Option<ScopeId>, | 41 | parent: Option<ScopeId>, |
42 | block: Option<BlockId>, | ||
42 | entries: Vec<ScopeEntry>, | 43 | entries: Vec<ScopeEntry>, |
43 | } | 44 | } |
44 | 45 | ||
@@ -61,6 +62,11 @@ impl ExprScopes { | |||
61 | &self.scopes[scope].entries | 62 | &self.scopes[scope].entries |
62 | } | 63 | } |
63 | 64 | ||
65 | /// If `scope` refers to a block expression scope, returns the corresponding `BlockId`. | ||
66 | pub fn block(&self, scope: ScopeId) -> Option<BlockId> { | ||
67 | self.scopes[scope].block | ||
68 | } | ||
69 | |||
64 | pub fn scope_chain(&self, scope: Option<ScopeId>) -> impl Iterator<Item = ScopeId> + '_ { | 70 | pub fn scope_chain(&self, scope: Option<ScopeId>) -> impl Iterator<Item = ScopeId> + '_ { |
65 | std::iter::successors(scope, move |&scope| self.scopes[scope].parent) | 71 | std::iter::successors(scope, move |&scope| self.scopes[scope].parent) |
66 | } | 72 | } |
@@ -79,11 +85,15 @@ impl ExprScopes { | |||
79 | } | 85 | } |
80 | 86 | ||
81 | fn root_scope(&mut self) -> ScopeId { | 87 | fn root_scope(&mut self) -> ScopeId { |
82 | self.scopes.alloc(ScopeData { parent: None, entries: vec![] }) | 88 | self.scopes.alloc(ScopeData { parent: None, block: None, entries: vec![] }) |
83 | } | 89 | } |
84 | 90 | ||
85 | fn new_scope(&mut self, parent: ScopeId) -> ScopeId { | 91 | fn new_scope(&mut self, parent: ScopeId) -> ScopeId { |
86 | self.scopes.alloc(ScopeData { parent: Some(parent), entries: vec![] }) | 92 | self.scopes.alloc(ScopeData { parent: Some(parent), block: None, entries: vec![] }) |
93 | } | ||
94 | |||
95 | fn new_block_scope(&mut self, parent: ScopeId, block: BlockId) -> ScopeId { | ||
96 | self.scopes.alloc(ScopeData { parent: Some(parent), block: Some(block), entries: vec![] }) | ||
87 | } | 97 | } |
88 | 98 | ||
89 | fn add_bindings(&mut self, body: &Body, scope: ScopeId, pat: PatId) { | 99 | fn add_bindings(&mut self, body: &Body, scope: ScopeId, pat: PatId) { |
@@ -136,7 +146,11 @@ fn compute_block_scopes( | |||
136 | fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope: ScopeId) { | 146 | fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope: ScopeId) { |
137 | scopes.set_scope(expr, scope); | 147 | scopes.set_scope(expr, scope); |
138 | match &body[expr] { | 148 | match &body[expr] { |
139 | Expr::Block { statements, tail, .. } => { | 149 | Expr::Block { statements, tail, id, .. } => { |
150 | let scope = scopes.new_block_scope(scope, *id); | ||
151 | // Overwrite the old scope for the block expr, so that every block scope can be found | ||
152 | // via the block itself (important for blocks that only contain items, no expressions). | ||
153 | scopes.set_scope(expr, scope); | ||
140 | compute_block_scopes(&statements, *tail, body, scopes, scope); | 154 | compute_block_scopes(&statements, *tail, body, scopes, scope); |
141 | } | 155 | } |
142 | Expr::For { iterable, pat, body: body_expr, .. } => { | 156 | Expr::For { iterable, pat, body: body_expr, .. } => { |
diff --git a/crates/hir_def/src/body/tests.rs b/crates/hir_def/src/body/tests.rs index a92134ba7..bb43569d7 100644 --- a/crates/hir_def/src/body/tests.rs +++ b/crates/hir_def/src/body/tests.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | mod block; | 1 | mod block; |
2 | 2 | ||
3 | use base_db::{fixture::WithFixture, FilePosition, SourceDatabase}; | 3 | use base_db::{fixture::WithFixture, SourceDatabase}; |
4 | use expect_test::Expect; | 4 | use expect_test::Expect; |
5 | use test_utils::mark; | 5 | use test_utils::mark; |
6 | 6 | ||
7 | use crate::{test_db::TestDB, BlockId, ModuleDefId}; | 7 | use crate::{test_db::TestDB, ModuleDefId}; |
8 | 8 | ||
9 | use super::*; | 9 | use super::*; |
10 | 10 | ||
@@ -37,104 +37,8 @@ fn check_diagnostics(ra_fixture: &str) { | |||
37 | fn block_def_map_at(ra_fixture: &str) -> String { | 37 | fn block_def_map_at(ra_fixture: &str) -> String { |
38 | let (db, position) = crate::test_db::TestDB::with_position(ra_fixture); | 38 | let (db, position) = crate::test_db::TestDB::with_position(ra_fixture); |
39 | 39 | ||
40 | let krate = db.crate_graph().iter().next().unwrap(); | 40 | let module = db.module_at_position(position); |
41 | let def_map = db.crate_def_map(krate); | 41 | module.def_map(&db).dump(&db) |
42 | |||
43 | let mut block = | ||
44 | block_at_pos(&db, &def_map, position).expect("couldn't find enclosing function or block"); | ||
45 | loop { | ||
46 | let def_map = db.block_def_map(block).unwrap_or_else(|| def_map.clone()); | ||
47 | let new_block = block_at_pos(&db, &def_map, position); | ||
48 | match new_block { | ||
49 | Some(new_block) => { | ||
50 | assert_ne!(block, new_block); | ||
51 | block = new_block; | ||
52 | } | ||
53 | None => { | ||
54 | return def_map.dump(&db); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | |||
60 | fn block_at_pos(db: &dyn DefDatabase, def_map: &DefMap, position: FilePosition) -> Option<BlockId> { | ||
61 | // Find the smallest (innermost) function containing the cursor. | ||
62 | let mut size = None; | ||
63 | let mut fn_def = None; | ||
64 | for (_, module) in def_map.modules() { | ||
65 | let file_id = module.definition_source(db).file_id; | ||
66 | if file_id != position.file_id.into() { | ||
67 | continue; | ||
68 | } | ||
69 | let root = db.parse_or_expand(file_id).unwrap(); | ||
70 | let ast_map = db.ast_id_map(file_id); | ||
71 | let item_tree = db.item_tree(file_id); | ||
72 | for decl in module.scope.declarations() { | ||
73 | if let ModuleDefId::FunctionId(it) = decl { | ||
74 | let ast = ast_map.get(item_tree[it.lookup(db).id.value].ast_id).to_node(&root); | ||
75 | let range = ast.syntax().text_range(); | ||
76 | |||
77 | if !range.contains(position.offset) { | ||
78 | continue; | ||
79 | } | ||
80 | |||
81 | let new_size = match size { | ||
82 | None => range.len(), | ||
83 | Some(size) => { | ||
84 | if range.len() < size { | ||
85 | range.len() | ||
86 | } else { | ||
87 | size | ||
88 | } | ||
89 | } | ||
90 | }; | ||
91 | if size != Some(new_size) { | ||
92 | size = Some(new_size); | ||
93 | fn_def = Some(it); | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | |||
99 | let (body, source_map) = db.body_with_source_map(fn_def?.into()); | ||
100 | |||
101 | // Now find the smallest encompassing block expression in the function body. | ||
102 | let mut size = None; | ||
103 | let mut block_id = None; | ||
104 | for (expr_id, expr) in body.exprs.iter() { | ||
105 | if let Expr::Block { id, .. } = expr { | ||
106 | if let Ok(ast) = source_map.expr_syntax(expr_id) { | ||
107 | if ast.file_id != position.file_id.into() { | ||
108 | continue; | ||
109 | } | ||
110 | |||
111 | let root = db.parse_or_expand(ast.file_id).unwrap(); | ||
112 | let ast = ast.value.to_node(&root); | ||
113 | let range = ast.syntax().text_range(); | ||
114 | |||
115 | if !range.contains(position.offset) { | ||
116 | continue; | ||
117 | } | ||
118 | |||
119 | let new_size = match size { | ||
120 | None => range.len(), | ||
121 | Some(size) => { | ||
122 | if range.len() < size { | ||
123 | range.len() | ||
124 | } else { | ||
125 | size | ||
126 | } | ||
127 | } | ||
128 | }; | ||
129 | if size != Some(new_size) { | ||
130 | size = Some(new_size); | ||
131 | block_id = Some(*id); | ||
132 | } | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | |||
137 | Some(block_id.expect("can't find block containing cursor")) | ||
138 | } | 42 | } |
139 | 43 | ||
140 | fn check_at(ra_fixture: &str, expect: Expect) { | 44 | fn check_at(ra_fixture: &str, expect: Expect) { |
diff --git a/crates/hir_def/src/body/tests/block.rs b/crates/hir_def/src/body/tests/block.rs index b599c6269..a5ec0883f 100644 --- a/crates/hir_def/src/body/tests/block.rs +++ b/crates/hir_def/src/body/tests/block.rs | |||
@@ -232,3 +232,30 @@ fn f() { | |||
232 | "#]], | 232 | "#]], |
233 | ) | 233 | ) |
234 | } | 234 | } |
235 | |||
236 | #[test] | ||
237 | fn super_does_not_resolve_to_block_module() { | ||
238 | check_at( | ||
239 | r#" | ||
240 | fn main() { | ||
241 | struct Struct {} | ||
242 | mod module { | ||
243 | use super::Struct; | ||
244 | |||
245 | $0 | ||
246 | } | ||
247 | } | ||
248 | "#, | ||
249 | expect![[r#" | ||
250 | block scope | ||
251 | Struct: t | ||
252 | module: t | ||
253 | |||
254 | block scope::module | ||
255 | Struct: _ | ||
256 | |||
257 | crate | ||
258 | main: v | ||
259 | "#]], | ||
260 | ); | ||
261 | } | ||
diff --git a/crates/hir_def/src/find_path.rs b/crates/hir_def/src/find_path.rs index aa2c6e04e..5e2a711b8 100644 --- a/crates/hir_def/src/find_path.rs +++ b/crates/hir_def/src/find_path.rs | |||
@@ -13,8 +13,6 @@ use crate::{ | |||
13 | ModuleDefId, ModuleId, | 13 | ModuleDefId, ModuleId, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | // FIXME: handle local items | ||
17 | |||
18 | /// Find a path that can be used to refer to a certain item. This can depend on | 16 | /// Find a path that can be used to refer to a certain item. This can depend on |
19 | /// *from where* you're referring to the item, hence the `from` parameter. | 17 | /// *from where* you're referring to the item, hence the `from` parameter. |
20 | pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> { | 18 | pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> { |
@@ -107,9 +105,9 @@ fn find_path_inner( | |||
107 | 105 | ||
108 | // - if the item is already in scope, return the name under which it is | 106 | // - if the item is already in scope, return the name under which it is |
109 | let def_map = from.def_map(db); | 107 | let def_map = from.def_map(db); |
110 | let from_scope: &crate::item_scope::ItemScope = &def_map[from.local_id].scope; | 108 | let scope_name = def_map.with_ancestor_maps(db, from.local_id, &mut |def_map, local_id| { |
111 | let scope_name = | 109 | def_map[local_id].scope.name_of(item).map(|(name, _)| name.clone()) |
112 | if let Some((name, _)) = from_scope.name_of(item) { Some(name.clone()) } else { None }; | 110 | }); |
113 | if prefixed.is_none() && scope_name.is_some() { | 111 | if prefixed.is_none() && scope_name.is_some() { |
114 | return scope_name | 112 | return scope_name |
115 | .map(|scope_name| ModPath::from_segments(PathKind::Plain, vec![scope_name])); | 113 | .map(|scope_name| ModPath::from_segments(PathKind::Plain, vec![scope_name])); |
@@ -117,7 +115,7 @@ fn find_path_inner( | |||
117 | 115 | ||
118 | // - if the item is the crate root, return `crate` | 116 | // - if the item is the crate root, return `crate` |
119 | let root = def_map.module_id(def_map.root()); | 117 | let root = def_map.module_id(def_map.root()); |
120 | if item == ItemInNs::Types(ModuleDefId::ModuleId(root)) { | 118 | if item == ItemInNs::Types(ModuleDefId::ModuleId(root)) && def_map.block_id().is_none() { |
121 | return Some(ModPath::from_segments(PathKind::Crate, Vec::new())); | 119 | return Some(ModPath::from_segments(PathKind::Crate, Vec::new())); |
122 | } | 120 | } |
123 | 121 | ||
@@ -230,7 +228,12 @@ fn find_path_inner( | |||
230 | } | 228 | } |
231 | } | 229 | } |
232 | 230 | ||
233 | if let Some(prefix) = prefixed.map(PrefixKind::prefix) { | 231 | if let Some(mut prefix) = prefixed.map(PrefixKind::prefix) { |
232 | if matches!(prefix, PathKind::Crate | PathKind::Super(0)) && def_map.block_id().is_some() { | ||
233 | // Inner items cannot be referred to via `crate::` or `self::` paths. | ||
234 | prefix = PathKind::Plain; | ||
235 | } | ||
236 | |||
234 | best_path.or_else(|| { | 237 | best_path.or_else(|| { |
235 | scope_name.map(|scope_name| ModPath::from_segments(prefix, vec![scope_name])) | 238 | scope_name.map(|scope_name| ModPath::from_segments(prefix, vec![scope_name])) |
236 | }) | 239 | }) |
@@ -358,14 +361,14 @@ mod tests { | |||
358 | /// module the cursor is in. | 361 | /// module the cursor is in. |
359 | fn check_found_path_(ra_fixture: &str, path: &str, prefix_kind: Option<PrefixKind>) { | 362 | fn check_found_path_(ra_fixture: &str, path: &str, prefix_kind: Option<PrefixKind>) { |
360 | let (db, pos) = TestDB::with_position(ra_fixture); | 363 | let (db, pos) = TestDB::with_position(ra_fixture); |
361 | let module = db.module_for_file(pos.file_id); | 364 | let module = db.module_at_position(pos); |
362 | let parsed_path_file = syntax::SourceFile::parse(&format!("use {};", path)); | 365 | let parsed_path_file = syntax::SourceFile::parse(&format!("use {};", path)); |
363 | let ast_path = | 366 | let ast_path = |
364 | parsed_path_file.syntax_node().descendants().find_map(syntax::ast::Path::cast).unwrap(); | 367 | parsed_path_file.syntax_node().descendants().find_map(syntax::ast::Path::cast).unwrap(); |
365 | let mod_path = ModPath::from_src(ast_path, &Hygiene::new_unhygienic()).unwrap(); | 368 | let mod_path = ModPath::from_src(ast_path, &Hygiene::new_unhygienic()).unwrap(); |
366 | 369 | ||
367 | let crate_def_map = module.def_map(&db); | 370 | let def_map = module.def_map(&db); |
368 | let resolved = crate_def_map | 371 | let resolved = def_map |
369 | .resolve_path( | 372 | .resolve_path( |
370 | &db, | 373 | &db, |
371 | module.local_id, | 374 | module.local_id, |
@@ -788,4 +791,82 @@ mod tests { | |||
788 | check_found_path(code, "u8", "u8", "u8", "u8"); | 791 | check_found_path(code, "u8", "u8", "u8", "u8"); |
789 | check_found_path(code, "u16", "u16", "u16", "u16"); | 792 | check_found_path(code, "u16", "u16", "u16", "u16"); |
790 | } | 793 | } |
794 | |||
795 | #[test] | ||
796 | fn inner_items() { | ||
797 | check_found_path( | ||
798 | r#" | ||
799 | fn main() { | ||
800 | struct Inner {} | ||
801 | $0 | ||
802 | } | ||
803 | "#, | ||
804 | "Inner", | ||
805 | "Inner", | ||
806 | "Inner", | ||
807 | "Inner", | ||
808 | ); | ||
809 | } | ||
810 | |||
811 | #[test] | ||
812 | fn inner_items_from_outer_scope() { | ||
813 | check_found_path( | ||
814 | r#" | ||
815 | fn main() { | ||
816 | struct Struct {} | ||
817 | { | ||
818 | $0 | ||
819 | } | ||
820 | } | ||
821 | "#, | ||
822 | "Struct", | ||
823 | "Struct", | ||
824 | "Struct", | ||
825 | "Struct", | ||
826 | ); | ||
827 | } | ||
828 | |||
829 | #[test] | ||
830 | fn inner_items_from_inner_module() { | ||
831 | check_found_path( | ||
832 | r#" | ||
833 | fn main() { | ||
834 | mod module { | ||
835 | struct Struct {} | ||
836 | } | ||
837 | { | ||
838 | $0 | ||
839 | } | ||
840 | } | ||
841 | "#, | ||
842 | "module::Struct", | ||
843 | "module::Struct", | ||
844 | "module::Struct", | ||
845 | "module::Struct", | ||
846 | ); | ||
847 | } | ||
848 | |||
849 | #[test] | ||
850 | #[ignore] | ||
851 | fn inner_items_from_parent_module() { | ||
852 | // FIXME: ItemTree currently associates all inner items with `main`. Luckily, this sort of | ||
853 | // code is very rare, so this isn't terrible. | ||
854 | // To fix it, we should probably build dedicated `ItemTree`s for inner items, and not store | ||
855 | // them in the file's main ItemTree. This would also allow us to stop parsing function | ||
856 | // bodies when we only want to compute the crate's main DefMap. | ||
857 | check_found_path( | ||
858 | r#" | ||
859 | fn main() { | ||
860 | struct Struct {} | ||
861 | mod module { | ||
862 | $0 | ||
863 | } | ||
864 | } | ||
865 | "#, | ||
866 | "super::Struct", | ||
867 | "super::Struct", | ||
868 | "super::Struct", | ||
869 | "super::Struct", | ||
870 | ); | ||
871 | } | ||
791 | } | 872 | } |
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index ad2e9bcac..34ff07f3c 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -316,7 +316,7 @@ impl DefMap { | |||
316 | /// | 316 | /// |
317 | /// If `f` returns `Some(val)`, iteration is stopped and `Some(val)` is returned. If `f` returns | 317 | /// If `f` returns `Some(val)`, iteration is stopped and `Some(val)` is returned. If `f` returns |
318 | /// `None`, iteration continues. | 318 | /// `None`, iteration continues. |
319 | fn with_ancestor_maps<T>( | 319 | pub fn with_ancestor_maps<T>( |
320 | &self, | 320 | &self, |
321 | db: &dyn DefDatabase, | 321 | db: &dyn DefDatabase, |
322 | local_mod: LocalModuleId, | 322 | local_mod: LocalModuleId, |
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index f9ad50301..a8467c88e 100644 --- a/crates/hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs | |||
@@ -10,7 +10,6 @@ use rustc_hash::FxHashSet; | |||
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | body::scope::{ExprScopes, ScopeId}, | 12 | body::scope::{ExprScopes, ScopeId}, |
13 | body::Body, | ||
14 | builtin_type::BuiltinType, | 13 | builtin_type::BuiltinType, |
15 | db::DefDatabase, | 14 | db::DefDatabase, |
16 | expr::{ExprId, PatId}, | 15 | expr::{ExprId, PatId}, |
@@ -58,8 +57,6 @@ enum Scope { | |||
58 | AdtScope(AdtId), | 57 | AdtScope(AdtId), |
59 | /// Local bindings | 58 | /// Local bindings |
60 | ExprScope(ExprScope), | 59 | ExprScope(ExprScope), |
61 | /// Temporary hack to support local items. | ||
62 | LocalItemsScope(Arc<Body>), | ||
63 | } | 60 | } |
64 | 61 | ||
65 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 62 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -169,13 +166,7 @@ impl Resolver { | |||
169 | for scope in self.scopes.iter().rev() { | 166 | for scope in self.scopes.iter().rev() { |
170 | match scope { | 167 | match scope { |
171 | Scope::ExprScope(_) => continue, | 168 | Scope::ExprScope(_) => continue, |
172 | Scope::GenericParams { .. } | 169 | Scope::GenericParams { .. } | Scope::ImplDefScope(_) if skip_to_mod => continue, |
173 | | Scope::ImplDefScope(_) | ||
174 | | Scope::LocalItemsScope(_) | ||
175 | if skip_to_mod => | ||
176 | { | ||
177 | continue | ||
178 | } | ||
179 | 170 | ||
180 | Scope::GenericParams { params, def } => { | 171 | Scope::GenericParams { params, def } => { |
181 | if let Some(local_id) = params.find_type_by_name(first_name) { | 172 | if let Some(local_id) = params.find_type_by_name(first_name) { |
@@ -199,41 +190,13 @@ impl Resolver { | |||
199 | } | 190 | } |
200 | } | 191 | } |
201 | Scope::ModuleScope(m) => { | 192 | Scope::ModuleScope(m) => { |
202 | let (module_def, idx) = m.crate_def_map.resolve_path( | 193 | if let Some(res) = m.resolve_path_in_type_ns(db, path) { |
203 | db, | 194 | return Some(res); |
204 | m.module_id, | ||
205 | &path, | ||
206 | BuiltinShadowMode::Other, | ||
207 | ); | ||
208 | let res = to_type_ns(module_def)?; | ||
209 | return Some((res, idx)); | ||
210 | } | ||
211 | Scope::LocalItemsScope(body) => { | ||
212 | let def = body.item_scope.get(first_name); | ||
213 | if let Some(res) = to_type_ns(def) { | ||
214 | return Some((res, None)); | ||
215 | } | 195 | } |
216 | } | 196 | } |
217 | } | 197 | } |
218 | } | 198 | } |
219 | return None; | 199 | None |
220 | fn to_type_ns(per_ns: PerNs) -> Option<TypeNs> { | ||
221 | let res = match per_ns.take_types()? { | ||
222 | ModuleDefId::AdtId(it) => TypeNs::AdtId(it), | ||
223 | ModuleDefId::EnumVariantId(it) => TypeNs::EnumVariantId(it), | ||
224 | |||
225 | ModuleDefId::TypeAliasId(it) => TypeNs::TypeAliasId(it), | ||
226 | ModuleDefId::BuiltinType(it) => TypeNs::BuiltinType(it), | ||
227 | |||
228 | ModuleDefId::TraitId(it) => TypeNs::TraitId(it), | ||
229 | |||
230 | ModuleDefId::FunctionId(_) | ||
231 | | ModuleDefId::ConstId(_) | ||
232 | | ModuleDefId::StaticId(_) | ||
233 | | ModuleDefId::ModuleId(_) => return None, | ||
234 | }; | ||
235 | Some(res) | ||
236 | } | ||
237 | } | 200 | } |
238 | 201 | ||
239 | pub fn resolve_path_in_type_ns_fully( | 202 | pub fn resolve_path_in_type_ns_fully( |
@@ -280,7 +243,6 @@ impl Resolver { | |||
280 | | Scope::ExprScope(_) | 243 | | Scope::ExprScope(_) |
281 | | Scope::GenericParams { .. } | 244 | | Scope::GenericParams { .. } |
282 | | Scope::ImplDefScope(_) | 245 | | Scope::ImplDefScope(_) |
283 | | Scope::LocalItemsScope(_) | ||
284 | if skip_to_mod => | 246 | if skip_to_mod => |
285 | { | 247 | { |
286 | continue | 248 | continue |
@@ -335,63 +297,14 @@ impl Resolver { | |||
335 | } | 297 | } |
336 | 298 | ||
337 | Scope::ModuleScope(m) => { | 299 | Scope::ModuleScope(m) => { |
338 | let (module_def, idx) = m.crate_def_map.resolve_path( | 300 | if let Some(def) = m.resolve_path_in_value_ns(db, path) { |
339 | db, | 301 | return Some(def); |
340 | m.module_id, | ||
341 | &path, | ||
342 | BuiltinShadowMode::Other, | ||
343 | ); | ||
344 | return match idx { | ||
345 | None => { | ||
346 | let value = to_value_ns(module_def)?; | ||
347 | Some(ResolveValueResult::ValueNs(value)) | ||
348 | } | ||
349 | Some(idx) => { | ||
350 | let ty = match module_def.take_types()? { | ||
351 | ModuleDefId::AdtId(it) => TypeNs::AdtId(it), | ||
352 | ModuleDefId::TraitId(it) => TypeNs::TraitId(it), | ||
353 | ModuleDefId::TypeAliasId(it) => TypeNs::TypeAliasId(it), | ||
354 | ModuleDefId::BuiltinType(it) => TypeNs::BuiltinType(it), | ||
355 | |||
356 | ModuleDefId::ModuleId(_) | ||
357 | | ModuleDefId::FunctionId(_) | ||
358 | | ModuleDefId::EnumVariantId(_) | ||
359 | | ModuleDefId::ConstId(_) | ||
360 | | ModuleDefId::StaticId(_) => return None, | ||
361 | }; | ||
362 | Some(ResolveValueResult::Partial(ty, idx)) | ||
363 | } | ||
364 | }; | ||
365 | } | ||
366 | Scope::LocalItemsScope(body) => { | ||
367 | // we don't bother looking in the builtin scope here because there are no builtin values | ||
368 | let def = to_value_ns(body.item_scope.get(first_name)); | ||
369 | |||
370 | if let Some(res) = def { | ||
371 | return Some(ResolveValueResult::ValueNs(res)); | ||
372 | } | 302 | } |
373 | } | 303 | } |
374 | } | 304 | } |
375 | } | 305 | } |
376 | return None; | 306 | |
377 | 307 | None | |
378 | fn to_value_ns(per_ns: PerNs) -> Option<ValueNs> { | ||
379 | let res = match per_ns.take_values()? { | ||
380 | ModuleDefId::FunctionId(it) => ValueNs::FunctionId(it), | ||
381 | ModuleDefId::AdtId(AdtId::StructId(it)) => ValueNs::StructId(it), | ||
382 | ModuleDefId::EnumVariantId(it) => ValueNs::EnumVariantId(it), | ||
383 | ModuleDefId::ConstId(it) => ValueNs::ConstId(it), | ||
384 | ModuleDefId::StaticId(it) => ValueNs::StaticId(it), | ||
385 | |||
386 | ModuleDefId::AdtId(AdtId::EnumId(_)) | ||
387 | | ModuleDefId::AdtId(AdtId::UnionId(_)) | ||
388 | | ModuleDefId::TraitId(_) | ||
389 | | ModuleDefId::TypeAliasId(_) | ||
390 | | ModuleDefId::BuiltinType(_) | ||
391 | | ModuleDefId::ModuleId(_) => return None, | ||
392 | }; | ||
393 | Some(res) | ||
394 | } | ||
395 | } | 308 | } |
396 | 309 | ||
397 | pub fn resolve_path_in_value_ns_fully( | 310 | pub fn resolve_path_in_value_ns_fully( |
@@ -410,11 +323,6 @@ impl Resolver { | |||
410 | db: &dyn DefDatabase, | 323 | db: &dyn DefDatabase, |
411 | path: &ModPath, | 324 | path: &ModPath, |
412 | ) -> Option<MacroDefId> { | 325 | ) -> Option<MacroDefId> { |
413 | // Search item scope legacy macro first | ||
414 | if let Some(def) = self.resolve_local_macro_def(path) { | ||
415 | return Some(def); | ||
416 | } | ||
417 | |||
418 | let (item_map, module) = self.module_scope()?; | 326 | let (item_map, module) = self.module_scope()?; |
419 | item_map.resolve_path(db, module, &path, BuiltinShadowMode::Other).0.take_macros() | 327 | item_map.resolve_path(db, module, &path, BuiltinShadowMode::Other).0.take_macros() |
420 | } | 328 | } |
@@ -447,16 +355,6 @@ impl Resolver { | |||
447 | }) | 355 | }) |
448 | } | 356 | } |
449 | 357 | ||
450 | fn resolve_local_macro_def(&self, path: &ModPath) -> Option<MacroDefId> { | ||
451 | let name = path.as_ident()?; | ||
452 | self.scopes.iter().rev().find_map(|scope| { | ||
453 | if let Scope::LocalItemsScope(body) = scope { | ||
454 | return body.item_scope.get_legacy_macro(name); | ||
455 | } | ||
456 | None | ||
457 | }) | ||
458 | } | ||
459 | |||
460 | pub fn module(&self) -> Option<ModuleId> { | 358 | pub fn module(&self) -> Option<ModuleId> { |
461 | let (def_map, local_id) = self.module_scope()?; | 359 | let (def_map, local_id) = self.module_scope()?; |
462 | Some(def_map.module_id(local_id)) | 360 | Some(def_map.module_id(local_id)) |
@@ -538,9 +436,6 @@ impl Scope { | |||
538 | }); | 436 | }); |
539 | } | 437 | } |
540 | } | 438 | } |
541 | Scope::LocalItemsScope(body) => body.item_scope.entries().for_each(|(name, def)| { | ||
542 | f(name.clone(), ScopeDef::PerNs(def)); | ||
543 | }), | ||
544 | &Scope::GenericParams { ref params, def: parent } => { | 439 | &Scope::GenericParams { ref params, def: parent } => { |
545 | for (local_id, param) in params.types.iter() { | 440 | for (local_id, param) in params.types.iter() { |
546 | if let Some(ref name) = param.name { | 441 | if let Some(ref name) = param.name { |
@@ -584,10 +479,19 @@ pub fn resolver_for_scope( | |||
584 | scope_id: Option<ScopeId>, | 479 | scope_id: Option<ScopeId>, |
585 | ) -> Resolver { | 480 | ) -> Resolver { |
586 | let mut r = owner.resolver(db); | 481 | let mut r = owner.resolver(db); |
587 | r = r.push_local_items_scope(db.body(owner)); | ||
588 | let scopes = db.expr_scopes(owner); | 482 | let scopes = db.expr_scopes(owner); |
589 | let scope_chain = scopes.scope_chain(scope_id).collect::<Vec<_>>(); | 483 | let scope_chain = scopes.scope_chain(scope_id).collect::<Vec<_>>(); |
590 | for scope in scope_chain.into_iter().rev() { | 484 | for scope in scope_chain.into_iter().rev() { |
485 | if let Some(block) = scopes.block(scope) { | ||
486 | if let Some(def_map) = db.block_def_map(block) { | ||
487 | let root = def_map.root(); | ||
488 | r = r.push_module_scope(def_map, root); | ||
489 | // FIXME: This adds as many module scopes as there are blocks, but resolving in each | ||
490 | // already traverses all parents, so this is O(n²). I think we could only store the | ||
491 | // innermost module scope instead? | ||
492 | } | ||
493 | } | ||
494 | |||
591 | r = r.push_expr_scope(owner, Arc::clone(&scopes), scope); | 495 | r = r.push_expr_scope(owner, Arc::clone(&scopes), scope); |
592 | } | 496 | } |
593 | r | 497 | r |
@@ -612,10 +516,6 @@ impl Resolver { | |||
612 | self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id })) | 516 | self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id })) |
613 | } | 517 | } |
614 | 518 | ||
615 | fn push_local_items_scope(self, body: Arc<Body>) -> Resolver { | ||
616 | self.push_scope(Scope::LocalItemsScope(body)) | ||
617 | } | ||
618 | |||
619 | fn push_expr_scope( | 519 | fn push_expr_scope( |
620 | self, | 520 | self, |
621 | owner: DefWithBodyId, | 521 | owner: DefWithBodyId, |
@@ -626,6 +526,85 @@ impl Resolver { | |||
626 | } | 526 | } |
627 | } | 527 | } |
628 | 528 | ||
529 | impl ModuleItemMap { | ||
530 | fn resolve_path_in_value_ns( | ||
531 | &self, | ||
532 | db: &dyn DefDatabase, | ||
533 | path: &ModPath, | ||
534 | ) -> Option<ResolveValueResult> { | ||
535 | let (module_def, idx) = | ||
536 | self.crate_def_map.resolve_path(db, self.module_id, &path, BuiltinShadowMode::Other); | ||
537 | match idx { | ||
538 | None => { | ||
539 | let value = to_value_ns(module_def)?; | ||
540 | Some(ResolveValueResult::ValueNs(value)) | ||
541 | } | ||
542 | Some(idx) => { | ||
543 | let ty = match module_def.take_types()? { | ||
544 | ModuleDefId::AdtId(it) => TypeNs::AdtId(it), | ||
545 | ModuleDefId::TraitId(it) => TypeNs::TraitId(it), | ||
546 | ModuleDefId::TypeAliasId(it) => TypeNs::TypeAliasId(it), | ||
547 | ModuleDefId::BuiltinType(it) => TypeNs::BuiltinType(it), | ||
548 | |||
549 | ModuleDefId::ModuleId(_) | ||
550 | | ModuleDefId::FunctionId(_) | ||
551 | | ModuleDefId::EnumVariantId(_) | ||
552 | | ModuleDefId::ConstId(_) | ||
553 | | ModuleDefId::StaticId(_) => return None, | ||
554 | }; | ||
555 | Some(ResolveValueResult::Partial(ty, idx)) | ||
556 | } | ||
557 | } | ||
558 | } | ||
559 | |||
560 | fn resolve_path_in_type_ns( | ||
561 | &self, | ||
562 | db: &dyn DefDatabase, | ||
563 | path: &ModPath, | ||
564 | ) -> Option<(TypeNs, Option<usize>)> { | ||
565 | let (module_def, idx) = | ||
566 | self.crate_def_map.resolve_path(db, self.module_id, &path, BuiltinShadowMode::Other); | ||
567 | let res = to_type_ns(module_def)?; | ||
568 | Some((res, idx)) | ||
569 | } | ||
570 | } | ||
571 | |||
572 | fn to_value_ns(per_ns: PerNs) -> Option<ValueNs> { | ||
573 | let res = match per_ns.take_values()? { | ||
574 | ModuleDefId::FunctionId(it) => ValueNs::FunctionId(it), | ||
575 | ModuleDefId::AdtId(AdtId::StructId(it)) => ValueNs::StructId(it), | ||
576 | ModuleDefId::EnumVariantId(it) => ValueNs::EnumVariantId(it), | ||
577 | ModuleDefId::ConstId(it) => ValueNs::ConstId(it), | ||
578 | ModuleDefId::StaticId(it) => ValueNs::StaticId(it), | ||
579 | |||
580 | ModuleDefId::AdtId(AdtId::EnumId(_)) | ||
581 | | ModuleDefId::AdtId(AdtId::UnionId(_)) | ||
582 | | ModuleDefId::TraitId(_) | ||
583 | | ModuleDefId::TypeAliasId(_) | ||
584 | | ModuleDefId::BuiltinType(_) | ||
585 | | ModuleDefId::ModuleId(_) => return None, | ||
586 | }; | ||
587 | Some(res) | ||
588 | } | ||
589 | |||
590 | fn to_type_ns(per_ns: PerNs) -> Option<TypeNs> { | ||
591 | let res = match per_ns.take_types()? { | ||
592 | ModuleDefId::AdtId(it) => TypeNs::AdtId(it), | ||
593 | ModuleDefId::EnumVariantId(it) => TypeNs::EnumVariantId(it), | ||
594 | |||
595 | ModuleDefId::TypeAliasId(it) => TypeNs::TypeAliasId(it), | ||
596 | ModuleDefId::BuiltinType(it) => TypeNs::BuiltinType(it), | ||
597 | |||
598 | ModuleDefId::TraitId(it) => TypeNs::TraitId(it), | ||
599 | |||
600 | ModuleDefId::FunctionId(_) | ||
601 | | ModuleDefId::ConstId(_) | ||
602 | | ModuleDefId::StaticId(_) | ||
603 | | ModuleDefId::ModuleId(_) => return None, | ||
604 | }; | ||
605 | Some(res) | ||
606 | } | ||
607 | |||
629 | pub trait HasResolver: Copy { | 608 | pub trait HasResolver: Copy { |
630 | /// Builds a resolver for type references inside this def. | 609 | /// Builds a resolver for type references inside this def. |
631 | fn resolver(self, db: &dyn DefDatabase) -> Resolver; | 610 | fn resolver(self, db: &dyn DefDatabase) -> Resolver; |
diff --git a/crates/hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs index 6665d902d..eda982c85 100644 --- a/crates/hir_def/src/test_db.rs +++ b/crates/hir_def/src/test_db.rs | |||
@@ -5,17 +5,17 @@ use std::{ | |||
5 | sync::{Arc, Mutex}, | 5 | sync::{Arc, Mutex}, |
6 | }; | 6 | }; |
7 | 7 | ||
8 | use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast}; | 8 | use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, FilePosition, Upcast}; |
9 | use base_db::{AnchoredPath, SourceDatabase}; | 9 | use base_db::{AnchoredPath, SourceDatabase}; |
10 | use hir_expand::db::AstDatabase; | ||
11 | use hir_expand::diagnostics::Diagnostic; | 10 | use hir_expand::diagnostics::Diagnostic; |
12 | use hir_expand::diagnostics::DiagnosticSinkBuilder; | 11 | use hir_expand::diagnostics::DiagnosticSinkBuilder; |
12 | use hir_expand::{db::AstDatabase, InFile}; | ||
13 | use rustc_hash::FxHashMap; | 13 | use rustc_hash::FxHashMap; |
14 | use rustc_hash::FxHashSet; | 14 | use rustc_hash::FxHashSet; |
15 | use syntax::{TextRange, TextSize}; | 15 | use syntax::{algo, ast, AstNode, TextRange, TextSize}; |
16 | use test_utils::extract_annotations; | 16 | use test_utils::extract_annotations; |
17 | 17 | ||
18 | use crate::{db::DefDatabase, ModuleDefId, ModuleId}; | 18 | use crate::{db::DefDatabase, nameres::DefMap, Lookup, ModuleDefId, ModuleId}; |
19 | 19 | ||
20 | #[salsa::database( | 20 | #[salsa::database( |
21 | base_db::SourceDatabaseExtStorage, | 21 | base_db::SourceDatabaseExtStorage, |
@@ -84,6 +84,97 @@ impl TestDB { | |||
84 | panic!("Can't find module for file") | 84 | panic!("Can't find module for file") |
85 | } | 85 | } |
86 | 86 | ||
87 | pub(crate) fn module_at_position(&self, position: FilePosition) -> ModuleId { | ||
88 | let file_module = self.module_for_file(position.file_id); | ||
89 | let mut def_map = file_module.def_map(self); | ||
90 | |||
91 | def_map = match self.block_at_position(&def_map, position) { | ||
92 | Some(it) => it, | ||
93 | None => return file_module, | ||
94 | }; | ||
95 | loop { | ||
96 | let new_map = self.block_at_position(&def_map, position); | ||
97 | match new_map { | ||
98 | Some(new_block) if !Arc::ptr_eq(&new_block, &def_map) => { | ||
99 | def_map = new_block; | ||
100 | } | ||
101 | _ => { | ||
102 | // FIXME: handle `mod` inside block expression | ||
103 | return def_map.module_id(def_map.root()); | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | } | ||
108 | |||
109 | fn block_at_position(&self, def_map: &DefMap, position: FilePosition) -> Option<Arc<DefMap>> { | ||
110 | // Find the smallest (innermost) function in `def_map` containing the cursor. | ||
111 | let mut size = None; | ||
112 | let mut fn_def = None; | ||
113 | for (_, module) in def_map.modules() { | ||
114 | let file_id = module.definition_source(self).file_id; | ||
115 | if file_id != position.file_id.into() { | ||
116 | continue; | ||
117 | } | ||
118 | let root = self.parse_or_expand(file_id).unwrap(); | ||
119 | let ast_map = self.ast_id_map(file_id); | ||
120 | let item_tree = self.item_tree(file_id); | ||
121 | for decl in module.scope.declarations() { | ||
122 | if let ModuleDefId::FunctionId(it) = decl { | ||
123 | let ast = | ||
124 | ast_map.get(item_tree[it.lookup(self).id.value].ast_id).to_node(&root); | ||
125 | let range = ast.syntax().text_range(); | ||
126 | |||
127 | if !range.contains(position.offset) { | ||
128 | continue; | ||
129 | } | ||
130 | |||
131 | let new_size = match size { | ||
132 | None => range.len(), | ||
133 | Some(size) => { | ||
134 | if range.len() < size { | ||
135 | range.len() | ||
136 | } else { | ||
137 | size | ||
138 | } | ||
139 | } | ||
140 | }; | ||
141 | if size != Some(new_size) { | ||
142 | size = Some(new_size); | ||
143 | fn_def = Some(it); | ||
144 | } | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | // Find the innermost block expression that has a `DefMap`. | ||
150 | let def_with_body = fn_def?.into(); | ||
151 | let (_, source_map) = self.body_with_source_map(def_with_body); | ||
152 | let scopes = self.expr_scopes(def_with_body); | ||
153 | let root = self.parse(position.file_id); | ||
154 | |||
155 | let scope_iter = algo::ancestors_at_offset(&root.syntax_node(), position.offset) | ||
156 | .filter_map(|node| { | ||
157 | let block = ast::BlockExpr::cast(node)?; | ||
158 | let expr = ast::Expr::from(block); | ||
159 | let expr_id = source_map.node_expr(InFile::new(position.file_id.into(), &expr))?; | ||
160 | let scope = scopes.scope_for(expr_id).unwrap(); | ||
161 | Some(scope) | ||
162 | }); | ||
163 | |||
164 | for scope in scope_iter { | ||
165 | let containing_blocks = | ||
166 | scopes.scope_chain(Some(scope)).filter_map(|scope| scopes.block(scope)); | ||
167 | |||
168 | for block in containing_blocks { | ||
169 | if let Some(def_map) = self.block_def_map(block) { | ||
170 | return Some(def_map); | ||
171 | } | ||
172 | } | ||
173 | } | ||
174 | |||
175 | None | ||
176 | } | ||
177 | |||
87 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event> { | 178 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event> { |
88 | *self.events.lock().unwrap() = Some(Vec::new()); | 179 | *self.events.lock().unwrap() = Some(Vec::new()); |
89 | f(); | 180 | f(); |
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index f6bf49546..418ac8cbb 100644 --- a/crates/hir_ty/Cargo.toml +++ b/crates/hir_ty/Cargo.toml | |||
@@ -17,9 +17,9 @@ ena = "0.14.0" | |||
17 | log = "0.4.8" | 17 | log = "0.4.8" |
18 | rustc-hash = "1.1.0" | 18 | rustc-hash = "1.1.0" |
19 | scoped-tls = "1" | 19 | scoped-tls = "1" |
20 | chalk-solve = { version = "0.55", default-features = false } | 20 | chalk-solve = { version = "0.56", default-features = false } |
21 | chalk-ir = "0.55" | 21 | chalk-ir = "0.56" |
22 | chalk-recursive = "0.55" | 22 | chalk-recursive = "0.56" |
23 | la-arena = { version = "0.2.0", path = "../../lib/arena" } | 23 | la-arena = { version = "0.2.0", path = "../../lib/arena" } |
24 | 24 | ||
25 | stdx = { path = "../stdx", version = "0.0.0" } | 25 | stdx = { path = "../stdx", version = "0.0.0" } |
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index a302456b0..b3d1fe9a4 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs | |||
@@ -10,25 +10,26 @@ use hir_def::{ | |||
10 | builtin_type::{IntBitness, Signedness}, | 10 | builtin_type::{IntBitness, Signedness}, |
11 | lang_item::LangItemTarget, | 11 | lang_item::LangItemTarget, |
12 | type_ref::Mutability, | 12 | type_ref::Mutability, |
13 | AssocContainerId, AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId, | 13 | AssocContainerId, AssocItemId, FunctionId, GenericDefId, HasModule, ImplId, Lookup, ModuleId, |
14 | TraitId, | ||
14 | }; | 15 | }; |
15 | use hir_expand::name::Name; | 16 | use hir_expand::name::Name; |
16 | use rustc_hash::{FxHashMap, FxHashSet}; | 17 | use rustc_hash::{FxHashMap, FxHashSet}; |
17 | 18 | ||
18 | use super::Substs; | ||
19 | use crate::{ | 19 | use crate::{ |
20 | autoderef, | 20 | autoderef, |
21 | db::HirDatabase, | 21 | db::HirDatabase, |
22 | primitive::{FloatBitness, FloatTy, IntTy}, | 22 | primitive::{FloatBitness, FloatTy, IntTy}, |
23 | utils::all_super_traits, | 23 | utils::all_super_traits, |
24 | ApplicationTy, Canonical, DebruijnIndex, InEnvironment, TraitEnvironment, TraitRef, Ty, TyKind, | 24 | ApplicationTy, Canonical, DebruijnIndex, InEnvironment, Substs, TraitEnvironment, TraitRef, Ty, |
25 | TypeCtor, TypeWalk, | 25 | TyKind, TypeCtor, TypeWalk, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /// This is used as a key for indexing impls. | 28 | /// This is used as a key for indexing impls. |
29 | #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | 29 | #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] |
30 | pub enum TyFingerprint { | 30 | pub enum TyFingerprint { |
31 | Apply(TypeCtor), | 31 | Apply(TypeCtor), |
32 | Dyn(TraitId), | ||
32 | } | 33 | } |
33 | 34 | ||
34 | impl TyFingerprint { | 35 | impl TyFingerprint { |
@@ -38,6 +39,7 @@ impl TyFingerprint { | |||
38 | pub(crate) fn for_impl(ty: &Ty) -> Option<TyFingerprint> { | 39 | pub(crate) fn for_impl(ty: &Ty) -> Option<TyFingerprint> { |
39 | match ty { | 40 | match ty { |
40 | Ty::Apply(a_ty) => Some(TyFingerprint::Apply(a_ty.ctor)), | 41 | Ty::Apply(a_ty) => Some(TyFingerprint::Apply(a_ty.ctor)), |
42 | Ty::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_)), | ||
41 | _ => None, | 43 | _ => None, |
42 | } | 44 | } |
43 | } | 45 | } |
@@ -245,18 +247,15 @@ impl Ty { | |||
245 | }}; | 247 | }}; |
246 | } | 248 | } |
247 | 249 | ||
250 | let mod_to_crate_ids = |module: ModuleId| Some(std::iter::once(module.krate()).collect()); | ||
251 | |||
248 | let lang_item_targets = match self { | 252 | let lang_item_targets = match self { |
249 | Ty::Apply(a_ty) => match a_ty.ctor { | 253 | Ty::Apply(a_ty) => match a_ty.ctor { |
250 | TypeCtor::Adt(def_id) => { | 254 | TypeCtor::Adt(def_id) => { |
251 | return Some(std::iter::once(def_id.module(db.upcast()).krate()).collect()) | 255 | return mod_to_crate_ids(def_id.module(db.upcast())); |
252 | } | 256 | } |
253 | TypeCtor::ForeignType(type_alias_id) => { | 257 | TypeCtor::ForeignType(type_alias_id) => { |
254 | return Some( | 258 | return mod_to_crate_ids(type_alias_id.lookup(db.upcast()).module(db.upcast())); |
255 | std::iter::once( | ||
256 | type_alias_id.lookup(db.upcast()).module(db.upcast()).krate(), | ||
257 | ) | ||
258 | .collect(), | ||
259 | ) | ||
260 | } | 259 | } |
261 | TypeCtor::Bool => lang_item_crate!("bool"), | 260 | TypeCtor::Bool => lang_item_crate!("bool"), |
262 | TypeCtor::Char => lang_item_crate!("char"), | 261 | TypeCtor::Char => lang_item_crate!("char"), |
@@ -272,6 +271,11 @@ impl Ty { | |||
272 | TypeCtor::RawPtr(Mutability::Mut) => lang_item_crate!("mut_ptr"), | 271 | TypeCtor::RawPtr(Mutability::Mut) => lang_item_crate!("mut_ptr"), |
273 | _ => return None, | 272 | _ => return None, |
274 | }, | 273 | }, |
274 | Ty::Dyn(_) => { | ||
275 | return self.dyn_trait().and_then(|trait_| { | ||
276 | mod_to_crate_ids(GenericDefId::TraitId(trait_).module(db.upcast())) | ||
277 | }); | ||
278 | } | ||
275 | _ => return None, | 279 | _ => return None, |
276 | }; | 280 | }; |
277 | let res = lang_item_targets | 281 | let res = lang_item_targets |
@@ -285,6 +289,7 @@ impl Ty { | |||
285 | Some(res) | 289 | Some(res) |
286 | } | 290 | } |
287 | } | 291 | } |
292 | |||
288 | /// Look up the method with the given name, returning the actual autoderefed | 293 | /// Look up the method with the given name, returning the actual autoderefed |
289 | /// receiver type (but without autoref applied yet). | 294 | /// receiver type (but without autoref applied yet). |
290 | pub(crate) fn lookup_method( | 295 | pub(crate) fn lookup_method( |
diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index c64f0b5b5..fb3afaedc 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs | |||
@@ -1,7 +1,5 @@ | |||
1 | use std::fs; | ||
2 | |||
3 | use expect_test::expect; | 1 | use expect_test::expect; |
4 | use test_utils::project_dir; | 2 | use test_utils::{bench, bench_fixture, skip_slow_tests}; |
5 | 3 | ||
6 | use super::{check_infer, check_types}; | 4 | use super::{check_infer, check_types}; |
7 | 5 | ||
@@ -617,12 +615,11 @@ hello | |||
617 | } | 615 | } |
618 | 616 | ||
619 | #[test] | 617 | #[test] |
620 | #[ignore] | 618 | fn benchmark_include_macro() { |
621 | fn include_accidentally_quadratic() { | 619 | if skip_slow_tests() { |
622 | let file = project_dir().join("crates/syntax/test_data/accidentally_quadratic"); | 620 | return; |
623 | let big_file = fs::read_to_string(file).unwrap(); | 621 | } |
624 | let big_file = vec![big_file; 10].join("\n"); | 622 | let data = bench_fixture::big_struct(); |
625 | |||
626 | let fixture = r#" | 623 | let fixture = r#" |
627 | //- /main.rs | 624 | //- /main.rs |
628 | #[rustc_builtin_macro] | 625 | #[rustc_builtin_macro] |
@@ -635,8 +632,12 @@ fn main() { | |||
635 | //^ RegisterBlock | 632 | //^ RegisterBlock |
636 | } | 633 | } |
637 | "#; | 634 | "#; |
638 | let fixture = format!("{}\n//- /foo.rs\n{}", fixture, big_file); | 635 | let fixture = format!("{}\n//- /foo.rs\n{}", fixture, data); |
639 | check_types(&fixture); | 636 | |
637 | { | ||
638 | let _b = bench("include macro"); | ||
639 | check_types(&fixture); | ||
640 | } | ||
640 | } | 641 | } |
641 | 642 | ||
642 | #[test] | 643 | #[test] |
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index a6a54e542..80e795fbf 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs | |||
@@ -1106,3 +1106,25 @@ fn main() { | |||
1106 | "#, | 1106 | "#, |
1107 | ); | 1107 | ); |
1108 | } | 1108 | } |
1109 | |||
1110 | #[test] | ||
1111 | fn method_on_dyn_impl() { | ||
1112 | check_types( | ||
1113 | r#" | ||
1114 | trait Foo {} | ||
1115 | |||
1116 | impl Foo for u32 {} | ||
1117 | impl dyn Foo { | ||
1118 | pub fn dyn_foo(&self) -> u32 { | ||
1119 | 0 | ||
1120 | } | ||
1121 | } | ||
1122 | |||
1123 | fn main() { | ||
1124 | let f = &42u32 as &dyn Foo<u32>; | ||
1125 | f.dyn_foo(); | ||
1126 | // ^u32 | ||
1127 | } | ||
1128 | "#, | ||
1129 | ); | ||
1130 | } | ||
diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index 6a4aa8333..54bd1c724 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs | |||
@@ -193,8 +193,9 @@ impl chalk_ir::interner::Interner for Interner { | |||
193 | tls::with_current_program(|prog| Some(prog?.debug_quantified_where_clauses(clauses, fmt))) | 193 | tls::with_current_program(|prog| Some(prog?.debug_quantified_where_clauses(clauses, fmt))) |
194 | } | 194 | } |
195 | 195 | ||
196 | fn intern_ty(&self, ty: chalk_ir::TyData<Self>) -> Arc<chalk_ir::TyData<Self>> { | 196 | fn intern_ty(&self, kind: chalk_ir::TyKind<Self>) -> Arc<chalk_ir::TyData<Self>> { |
197 | Arc::new(ty) | 197 | let flags = kind.compute_flags(self); |
198 | Arc::new(chalk_ir::TyData { kind, flags }) | ||
198 | } | 199 | } |
199 | 200 | ||
200 | fn ty_data<'a>(&self, ty: &'a Arc<chalk_ir::TyData<Self>>) -> &'a chalk_ir::TyData<Self> { | 201 | fn ty_data<'a>(&self, ty: &'a Arc<chalk_ir::TyData<Self>>) -> &'a chalk_ir::TyData<Self> { |
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 23d885218..198243466 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -85,12 +85,16 @@ impl NavigationTarget { | |||
85 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); | 85 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
86 | if let Some(src) = module.declaration_source(db) { | 86 | if let Some(src) = module.declaration_source(db) { |
87 | let node = src.as_ref().map(|it| it.syntax()); | 87 | let node = src.as_ref().map(|it| it.syntax()); |
88 | let frange = node.original_file_range(db); | 88 | let full_range = node.original_file_range(db); |
89 | let focus_range = src | ||
90 | .value | ||
91 | .name() | ||
92 | .map(|name| src.with_value(name.syntax()).original_file_range(db).range); | ||
89 | let mut res = NavigationTarget::from_syntax( | 93 | let mut res = NavigationTarget::from_syntax( |
90 | frange.file_id, | 94 | full_range.file_id, |
91 | name, | 95 | name, |
92 | None, | 96 | focus_range, |
93 | frange.range, | 97 | full_range.range, |
94 | SymbolKind::Module, | 98 | SymbolKind::Module, |
95 | ); | 99 | ); |
96 | res.docs = module.attrs(db).docs(); | 100 | res.docs = module.attrs(db).docs(); |
diff --git a/crates/ide/src/fixture.rs b/crates/ide/src/fixture.rs index cc8218885..cc6641ba1 100644 --- a/crates/ide/src/fixture.rs +++ b/crates/ide/src/fixture.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | //! Utilities for creating `Analysis` instances for tests. | 1 | //! Utilities for creating `Analysis` instances for tests. |
2 | use ide_db::base_db::fixture::ChangeFixture; | 2 | use ide_db::base_db::fixture::ChangeFixture; |
3 | use syntax::{TextRange, TextSize}; | ||
3 | use test_utils::{extract_annotations, RangeOrOffset}; | 4 | use test_utils::{extract_annotations, RangeOrOffset}; |
4 | 5 | ||
5 | use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; | 6 | use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; |
@@ -68,3 +69,18 @@ pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(Fil | |||
68 | .collect(); | 69 | .collect(); |
69 | (host.analysis(), FilePosition { file_id, offset }, annotations) | 70 | (host.analysis(), FilePosition { file_id, offset }, annotations) |
70 | } | 71 | } |
72 | |||
73 | pub(crate) fn nav_target_annotation(ra_fixture: &str) -> (Analysis, FilePosition, FileRange) { | ||
74 | let (analysis, position, mut annotations) = annotations(ra_fixture); | ||
75 | let (mut expected, data) = annotations.pop().unwrap(); | ||
76 | assert!(annotations.is_empty()); | ||
77 | match data.as_str() { | ||
78 | "" => (), | ||
79 | "file" => { | ||
80 | expected.range = | ||
81 | TextRange::up_to(TextSize::of(&*analysis.file_text(expected.file_id).unwrap())) | ||
82 | } | ||
83 | data => panic!("bad data: {}", data), | ||
84 | } | ||
85 | (analysis, position, expected) | ||
86 | } | ||
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 1a997fa40..e86ae2a18 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs | |||
@@ -131,22 +131,11 @@ pub(crate) fn reference_definition( | |||
131 | #[cfg(test)] | 131 | #[cfg(test)] |
132 | mod tests { | 132 | mod tests { |
133 | use ide_db::base_db::FileRange; | 133 | use ide_db::base_db::FileRange; |
134 | use syntax::{TextRange, TextSize}; | ||
135 | 134 | ||
136 | use crate::fixture; | 135 | use crate::fixture; |
137 | 136 | ||
138 | fn check(ra_fixture: &str) { | 137 | fn check(ra_fixture: &str) { |
139 | let (analysis, position, mut annotations) = fixture::annotations(ra_fixture); | 138 | let (analysis, position, expected) = fixture::nav_target_annotation(ra_fixture); |
140 | let (mut expected, data) = annotations.pop().unwrap(); | ||
141 | match data.as_str() { | ||
142 | "" => (), | ||
143 | "file" => { | ||
144 | expected.range = | ||
145 | TextRange::up_to(TextSize::of(&*analysis.file_text(expected.file_id).unwrap())) | ||
146 | } | ||
147 | data => panic!("bad data: {}", data), | ||
148 | } | ||
149 | |||
150 | let mut navs = | 139 | let mut navs = |
151 | analysis.goto_definition(position).unwrap().expect("no definition found").info; | 140 | analysis.goto_definition(position).unwrap().expect("no definition found").info; |
152 | if navs.len() == 0 { | 141 | if navs.len() == 0 { |
diff --git a/crates/ide/src/join_lines.rs b/crates/ide/src/join_lines.rs index 631bde0f1..e3f3985d1 100644 --- a/crates/ide/src/join_lines.rs +++ b/crates/ide/src/join_lines.rs | |||
@@ -270,27 +270,28 @@ fn foo() { | |||
270 | 270 | ||
271 | #[test] | 271 | #[test] |
272 | fn test_join_lines_diverging_block() { | 272 | fn test_join_lines_diverging_block() { |
273 | let before = r" | 273 | check_join_lines( |
274 | fn foo() { | 274 | r" |
275 | loop { | 275 | fn foo() { |
276 | match x { | 276 | loop { |
277 | 92 => $0{ | 277 | match x { |
278 | continue; | 278 | 92 => $0{ |
279 | } | 279 | continue; |
280 | } | ||
281 | } | ||
282 | } | ||
283 | "; | ||
284 | let after = r" | ||
285 | fn foo() { | ||
286 | loop { | ||
287 | match x { | ||
288 | 92 => $0continue, | ||
289 | } | ||
290 | } | ||
291 | } | 280 | } |
292 | "; | 281 | } |
293 | check_join_lines(before, after); | 282 | } |
283 | } | ||
284 | ", | ||
285 | r" | ||
286 | fn foo() { | ||
287 | loop { | ||
288 | match x { | ||
289 | 92 => $0continue, | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | ", | ||
294 | ); | ||
294 | } | 295 | } |
295 | 296 | ||
296 | #[test] | 297 | #[test] |
diff --git a/crates/ide/src/parent_module.rs b/crates/ide/src/parent_module.rs index d343638fb..ddbaf22b7 100644 --- a/crates/ide/src/parent_module.rs +++ b/crates/ide/src/parent_module.rs | |||
@@ -63,57 +63,62 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> { | |||
63 | 63 | ||
64 | #[cfg(test)] | 64 | #[cfg(test)] |
65 | mod tests { | 65 | mod tests { |
66 | use ide_db::base_db::FileRange; | ||
66 | use test_utils::mark; | 67 | use test_utils::mark; |
67 | 68 | ||
68 | use crate::fixture::{self}; | 69 | use crate::fixture; |
70 | |||
71 | fn check(ra_fixture: &str) { | ||
72 | let (analysis, position, expected) = fixture::nav_target_annotation(ra_fixture); | ||
73 | let mut navs = analysis.parent_module(position).unwrap(); | ||
74 | assert_eq!(navs.len(), 1); | ||
75 | let nav = navs.pop().unwrap(); | ||
76 | assert_eq!(expected, FileRange { file_id: nav.file_id, range: nav.focus_or_full_range() }); | ||
77 | } | ||
69 | 78 | ||
70 | #[test] | 79 | #[test] |
71 | fn test_resolve_parent_module() { | 80 | fn test_resolve_parent_module() { |
72 | let (analysis, pos) = fixture::position( | 81 | check( |
73 | " | 82 | r#" |
74 | //- /lib.rs | 83 | //- /lib.rs |
75 | mod foo; | 84 | mod foo; |
76 | //- /foo.rs | 85 | //^^^ |
77 | $0// empty | 86 | |
78 | ", | 87 | //- /foo.rs |
88 | $0// empty | ||
89 | "#, | ||
79 | ); | 90 | ); |
80 | let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); | ||
81 | nav.assert_match("foo Module FileId(0) 0..8"); | ||
82 | } | 91 | } |
83 | 92 | ||
84 | #[test] | 93 | #[test] |
85 | fn test_resolve_parent_module_on_module_decl() { | 94 | fn test_resolve_parent_module_on_module_decl() { |
86 | mark::check!(test_resolve_parent_module_on_module_decl); | 95 | mark::check!(test_resolve_parent_module_on_module_decl); |
87 | let (analysis, pos) = fixture::position( | 96 | check( |
88 | " | 97 | r#" |
89 | //- /lib.rs | 98 | //- /lib.rs |
90 | mod foo; | 99 | mod foo; |
91 | 100 | //^^^ | |
92 | //- /foo.rs | 101 | //- /foo.rs |
93 | mod $0bar; | 102 | mod $0bar; |
94 | 103 | ||
95 | //- /foo/bar.rs | 104 | //- /foo/bar.rs |
96 | // empty | 105 | // empty |
97 | ", | 106 | "#, |
98 | ); | 107 | ); |
99 | let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); | ||
100 | nav.assert_match("foo Module FileId(0) 0..8"); | ||
101 | } | 108 | } |
102 | 109 | ||
103 | #[test] | 110 | #[test] |
104 | fn test_resolve_parent_module_for_inline() { | 111 | fn test_resolve_parent_module_for_inline() { |
105 | let (analysis, pos) = fixture::position( | 112 | check( |
106 | " | 113 | r#" |
107 | //- /lib.rs | 114 | //- /lib.rs |
108 | mod foo { | 115 | mod foo { |
109 | mod bar { | 116 | mod bar { |
110 | mod baz { $0 } | 117 | mod baz { $0 } |
111 | } | 118 | } //^^^ |
112 | } | 119 | } |
113 | ", | 120 | "#, |
114 | ); | 121 | ); |
115 | let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); | ||
116 | nav.assert_match("baz Module FileId(0) 32..44"); | ||
117 | } | 122 | } |
118 | 123 | ||
119 | #[test] | 124 | #[test] |
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 40d9487eb..6999dacee 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -1114,4 +1114,27 @@ trait Foo { | |||
1114 | "#]], | 1114 | "#]], |
1115 | ); | 1115 | ); |
1116 | } | 1116 | } |
1117 | |||
1118 | #[test] | ||
1119 | fn test_self_variant_with_payload() { | ||
1120 | check( | ||
1121 | r#" | ||
1122 | enum Foo { Bar() } | ||
1123 | |||
1124 | impl Foo { | ||
1125 | fn foo(self) { | ||
1126 | match self { | ||
1127 | Self::Bar$0() => (), | ||
1128 | } | ||
1129 | } | ||
1130 | } | ||
1131 | |||
1132 | "#, | ||
1133 | expect![[r#" | ||
1134 | Bar Variant FileId(0) 11..16 11..14 Other | ||
1135 | |||
1136 | FileId(0) 89..92 Other | ||
1137 | "#]], | ||
1138 | ); | ||
1139 | } | ||
1117 | } | 1140 | } |
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 1854da914..9d0cd1af5 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -1,9 +1,8 @@ | |||
1 | use std::fs; | ||
2 | |||
3 | use expect_test::{expect_file, ExpectFile}; | 1 | use expect_test::{expect_file, ExpectFile}; |
4 | use test_utils::project_dir; | 2 | use ide_db::SymbolKind; |
3 | use test_utils::{bench, bench_fixture, skip_slow_tests}; | ||
5 | 4 | ||
6 | use crate::{fixture, FileRange, TextRange}; | 5 | use crate::{fixture, FileRange, HlTag, TextRange}; |
7 | 6 | ||
8 | #[test] | 7 | #[test] |
9 | fn test_highlighting() { | 8 | fn test_highlighting() { |
@@ -228,15 +227,45 @@ fn bar() { | |||
228 | } | 227 | } |
229 | 228 | ||
230 | #[test] | 229 | #[test] |
231 | fn accidentally_quadratic() { | 230 | fn benchmark_syntax_highlighting_long_struct() { |
232 | let file = project_dir().join("crates/syntax/test_data/accidentally_quadratic"); | 231 | if skip_slow_tests() { |
233 | let src = fs::read_to_string(file).unwrap(); | 232 | return; |
233 | } | ||
234 | 234 | ||
235 | let (analysis, file_id) = fixture::file(&src); | 235 | let fixture = bench_fixture::big_struct(); |
236 | let (analysis, file_id) = fixture::file(&fixture); | ||
236 | 237 | ||
237 | // let t = std::time::Instant::now(); | 238 | let hash = { |
238 | let _ = analysis.highlight(file_id).unwrap(); | 239 | let _pt = bench("syntax highlighting long struct"); |
239 | // eprintln!("elapsed: {:?}", t.elapsed()); | 240 | analysis |
241 | .highlight(file_id) | ||
242 | .unwrap() | ||
243 | .iter() | ||
244 | .filter(|it| it.highlight.tag == HlTag::Symbol(SymbolKind::Struct)) | ||
245 | .count() | ||
246 | }; | ||
247 | assert_eq!(hash, 2001); | ||
248 | } | ||
249 | |||
250 | #[test] | ||
251 | fn benchmark_syntax_highlighting_parser() { | ||
252 | if skip_slow_tests() { | ||
253 | return; | ||
254 | } | ||
255 | |||
256 | let fixture = bench_fixture::glorious_old_parser(); | ||
257 | let (analysis, file_id) = fixture::file(&fixture); | ||
258 | |||
259 | let hash = { | ||
260 | let _pt = bench("syntax highlighting parser"); | ||
261 | analysis | ||
262 | .highlight(file_id) | ||
263 | .unwrap() | ||
264 | .iter() | ||
265 | .filter(|it| it.highlight.tag == HlTag::Symbol(SymbolKind::Function)) | ||
266 | .count() | ||
267 | }; | ||
268 | assert_eq!(hash, 1629); | ||
240 | } | 269 | } |
241 | 270 | ||
242 | #[test] | 271 | #[test] |
diff --git a/crates/ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs index 4c63d3023..f979ba434 100644 --- a/crates/ide/src/syntax_tree.rs +++ b/crates/ide/src/syntax_tree.rs | |||
@@ -100,147 +100,137 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option<St | |||
100 | 100 | ||
101 | #[cfg(test)] | 101 | #[cfg(test)] |
102 | mod tests { | 102 | mod tests { |
103 | use test_utils::assert_eq_text; | 103 | use expect_test::expect; |
104 | 104 | ||
105 | use crate::fixture; | 105 | use crate::fixture; |
106 | 106 | ||
107 | fn check(ra_fixture: &str, expect: expect_test::Expect) { | ||
108 | let (analysis, file_id) = fixture::file(ra_fixture); | ||
109 | let syn = analysis.syntax_tree(file_id, None).unwrap(); | ||
110 | expect.assert_eq(&syn) | ||
111 | } | ||
112 | fn check_range(ra_fixture: &str, expect: expect_test::Expect) { | ||
113 | let (analysis, frange) = fixture::range(ra_fixture); | ||
114 | let syn = analysis.syntax_tree(frange.file_id, Some(frange.range)).unwrap(); | ||
115 | expect.assert_eq(&syn) | ||
116 | } | ||
117 | |||
107 | #[test] | 118 | #[test] |
108 | fn test_syntax_tree_without_range() { | 119 | fn test_syntax_tree_without_range() { |
109 | // Basic syntax | 120 | // Basic syntax |
110 | let (analysis, file_id) = fixture::file(r#"fn foo() {}"#); | 121 | check( |
111 | let syn = analysis.syntax_tree(file_id, None).unwrap(); | 122 | r#"fn foo() {}"#, |
112 | 123 | expect![[r#" | |
113 | assert_eq_text!( | 124 | [email protected] |
114 | r#" | 125 | [email protected] |
115 | [email protected] | 126 | [email protected] "fn" |
116 | [email protected] | 127 | [email protected] " " |
117 | [email protected] "fn" | 128 | [email protected] |
118 | [email protected] " " | 129 | [email protected] "foo" |
119 | [email protected] | 130 | [email protected] |
120 | [email protected] "foo" | 131 | [email protected] "(" |
121 | [email protected] | 132 | [email protected] ")" |
122 | [email protected] "(" | 133 | [email protected] " " |
123 | [email protected] ")" | 134 | [email protected] |
124 | [email protected] " " | 135 | [email protected] "{" |
125 | [email protected] | 136 | [email protected] "}" |
126 | [email protected] "{" | 137 | "#]], |
127 | [email protected] "}" | ||
128 | "# | ||
129 | .trim(), | ||
130 | syn.trim() | ||
131 | ); | 138 | ); |
132 | 139 | ||
133 | let (analysis, file_id) = fixture::file( | 140 | check( |
134 | r#" | 141 | r#" |
135 | fn test() { | 142 | fn test() { |
136 | assert!(" | 143 | assert!(" |
137 | fn foo() { | 144 | fn foo() { |
138 | } | 145 | } |
139 | ", ""); | 146 | ", ""); |
140 | }"# | 147 | }"#, |
141 | .trim(), | 148 | expect![[r#" |
142 | ); | 149 | [email protected] |
143 | let syn = analysis.syntax_tree(file_id, None).unwrap(); | 150 | [email protected] |
144 | 151 | [email protected] "fn" | |
145 | assert_eq_text!( | 152 | [email protected] " " |
146 | r#" | 153 | [email protected] |
147 | [email protected] | 154 | [email protected] "test" |
148 | [email protected] | 155 | [email protected] |
149 | [email protected] "fn" | 156 | [email protected] "(" |
150 | [email protected] " " | 157 | [email protected] ")" |
151 | [email protected] | 158 | [email protected] " " |
152 | [email protected] "test" | 159 | [email protected] |
153 | [email protected] | 160 | [email protected] "{" |
154 | [email protected] "(" | 161 | [email protected] "\n " |
155 | [email protected] ")" | 162 | [email protected] |
156 | [email protected] " " | 163 | [email protected] |
157 | [email protected] | 164 | [email protected] |
158 | [email protected] "{" | 165 | [email protected] |
159 | [email protected] "\n " | 166 | [email protected] |
160 | [email protected] | 167 | [email protected] "assert" |
161 | [email protected] | 168 | [email protected] "!" |
162 | [email protected] | 169 | [email protected] |
163 | [email protected] | 170 | [email protected] "(" |
164 | [email protected] | 171 | [email protected] "\"\n fn foo() {\n ..." |
165 | [email protected] "assert" | 172 | [email protected] "," |
166 | [email protected] "!" | 173 | [email protected] " " |
167 | [email protected] | 174 | [email protected] "\"\"" |
168 | [email protected] "(" | 175 | [email protected] ")" |
169 | [email protected] "\"\n fn foo() {\n ..." | 176 | [email protected] ";" |
170 | [email protected] "," | 177 | [email protected] "\n" |
171 | [email protected] " " | 178 | [email protected] "}" |
172 | [email protected] "\"\"" | 179 | "#]], |
173 | [email protected] ")" | 180 | ) |
174 | [email protected] ";" | ||
175 | [email protected] "\n" | ||
176 | [email protected] "}" | ||
177 | "# | ||
178 | .trim(), | ||
179 | syn.trim() | ||
180 | ); | ||
181 | } | 181 | } |
182 | 182 | ||
183 | #[test] | 183 | #[test] |
184 | fn test_syntax_tree_with_range() { | 184 | fn test_syntax_tree_with_range() { |
185 | let (analysis, range) = fixture::range(r#"$0fn foo() {}$0"#.trim()); | 185 | check_range( |
186 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); | 186 | r#"$0fn foo() {}$0"#, |
187 | 187 | expect![[r#" | |
188 | assert_eq_text!( | 188 | [email protected] |
189 | r#" | 189 | [email protected] "fn" |
190 | [email protected] | 190 | [email protected] " " |
191 | [email protected] "fn" | 191 | [email protected] |
192 | [email protected] " " | 192 | [email protected] "foo" |
193 | [email protected] | 193 | [email protected] |
194 | [email protected] "foo" | 194 | [email protected] "(" |
195 | [email protected] | 195 | [email protected] ")" |
196 | [email protected] "(" | 196 | [email protected] " " |
197 | [email protected] ")" | 197 | [email protected] |
198 | [email protected] " " | 198 | [email protected] "{" |
199 | [email protected] | 199 | [email protected] "}" |
200 | [email protected] "{" | 200 | "#]], |
201 | [email protected] "}" | ||
202 | "# | ||
203 | .trim(), | ||
204 | syn.trim() | ||
205 | ); | 201 | ); |
206 | 202 | ||
207 | let (analysis, range) = fixture::range( | 203 | check_range( |
208 | r#"fn test() { | 204 | r#" |
205 | fn test() { | ||
209 | $0assert!(" | 206 | $0assert!(" |
210 | fn foo() { | 207 | fn foo() { |
211 | } | 208 | } |
212 | ", "");$0 | 209 | ", "");$0 |
213 | }"# | 210 | }"#, |
214 | .trim(), | 211 | expect![[r#" |
215 | ); | 212 | [email protected] |
216 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); | 213 | [email protected] |
217 | 214 | [email protected] | |
218 | assert_eq_text!( | 215 | [email protected] |
219 | r#" | 216 | [email protected] |
220 | [email protected] | 217 | [email protected] "assert" |
221 | [email protected] | 218 | [email protected] "!" |
222 | [email protected] | 219 | [email protected] |
223 | [email protected] | 220 | [email protected] "(" |
224 | [email protected] | 221 | [email protected] "\"\n fn foo() {\n ..." |
225 | [email protected] "assert" | 222 | [email protected] "," |
226 | [email protected] "!" | 223 | [email protected] " " |
227 | [email protected] | 224 | [email protected] "\"\"" |
228 | [email protected] "(" | 225 | [email protected] ")" |
229 | [email protected] "\"\n fn foo() {\n ..." | 226 | [email protected] ";" |
230 | [email protected] "," | 227 | "#]], |
231 | [email protected] " " | ||
232 | [email protected] "\"\"" | ||
233 | [email protected] ")" | ||
234 | [email protected] ";" | ||
235 | "# | ||
236 | .trim(), | ||
237 | syn.trim() | ||
238 | ); | 228 | ); |
239 | } | 229 | } |
240 | 230 | ||
241 | #[test] | 231 | #[test] |
242 | fn test_syntax_tree_inside_string() { | 232 | fn test_syntax_tree_inside_string() { |
243 | let (analysis, range) = fixture::range( | 233 | check_range( |
244 | r#"fn test() { | 234 | r#"fn test() { |
245 | assert!(" | 235 | assert!(" |
246 | $0fn foo() { | 236 | $0fn foo() { |
@@ -248,33 +238,27 @@ $0fn foo() { | |||
248 | fn bar() { | 238 | fn bar() { |
249 | } | 239 | } |
250 | ", ""); | 240 | ", ""); |
251 | }"# | 241 | }"#, |
252 | .trim(), | 242 | expect![[r#" |
253 | ); | 243 | [email protected] |
254 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); | 244 | [email protected] |
255 | assert_eq_text!( | 245 | [email protected] "fn" |
256 | r#" | 246 | [email protected] " " |
257 | [email protected] | 247 | [email protected] |
258 | [email protected] | 248 | [email protected] "foo" |
259 | [email protected] "fn" | 249 | [email protected] |
260 | [email protected] " " | 250 | [email protected] "(" |
261 | [email protected] | 251 | [email protected] ")" |
262 | [email protected] "foo" | 252 | [email protected] " " |
263 | [email protected] | 253 | [email protected] |
264 | [email protected] "(" | 254 | [email protected] "{" |
265 | [email protected] ")" | 255 | [email protected] "\n" |
266 | [email protected] " " | 256 | [email protected] "}" |
267 | [email protected] | 257 | "#]], |
268 | [email protected] "{" | ||
269 | [email protected] "\n" | ||
270 | [email protected] "}" | ||
271 | "# | ||
272 | .trim(), | ||
273 | syn.trim() | ||
274 | ); | 258 | ); |
275 | 259 | ||
276 | // With a raw string | 260 | // With a raw string |
277 | let (analysis, range) = fixture::range( | 261 | check_range( |
278 | r###"fn test() { | 262 | r###"fn test() { |
279 | assert!(r#" | 263 | assert!(r#" |
280 | $0fn foo() { | 264 | $0fn foo() { |
@@ -282,76 +266,64 @@ $0fn foo() { | |||
282 | fn bar() { | 266 | fn bar() { |
283 | } | 267 | } |
284 | "#, ""); | 268 | "#, ""); |
285 | }"### | 269 | }"###, |
286 | .trim(), | 270 | expect![[r#" |
287 | ); | 271 | [email protected] |
288 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); | 272 | [email protected] |
289 | assert_eq_text!( | 273 | [email protected] "fn" |
290 | r#" | 274 | [email protected] " " |
291 | [email protected] | 275 | [email protected] |
292 | [email protected] | 276 | [email protected] "foo" |
293 | [email protected] "fn" | 277 | [email protected] |
294 | [email protected] " " | 278 | [email protected] "(" |
295 | [email protected] | 279 | [email protected] ")" |
296 | [email protected] "foo" | 280 | [email protected] " " |
297 | [email protected] | 281 | [email protected] |
298 | [email protected] "(" | 282 | [email protected] "{" |
299 | [email protected] ")" | 283 | [email protected] "\n" |
300 | [email protected] " " | 284 | [email protected] "}" |
301 | [email protected] | 285 | "#]], |
302 | [email protected] "{" | ||
303 | [email protected] "\n" | ||
304 | [email protected] "}" | ||
305 | "# | ||
306 | .trim(), | ||
307 | syn.trim() | ||
308 | ); | 286 | ); |
309 | 287 | ||
310 | // With a raw string | 288 | // With a raw string |
311 | let (analysis, range) = fixture::range( | 289 | check_range( |
312 | r###"fn test() { | 290 | r###"fn test() { |
313 | assert!(r$0#" | 291 | assert!(r$0#" |
314 | fn foo() { | 292 | fn foo() { |
315 | } | 293 | } |
316 | fn bar() { | 294 | fn bar() { |
317 | }"$0#, ""); | 295 | }"$0#, ""); |
318 | }"### | 296 | }"###, |
319 | .trim(), | 297 | expect![[r#" |
320 | ); | 298 | [email protected] |
321 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); | 299 | [email protected] |
322 | assert_eq_text!( | 300 | [email protected] "fn" |
323 | r#" | 301 | [email protected] " " |
324 | [email protected] | 302 | [email protected] |
325 | [email protected] | 303 | [email protected] "foo" |
326 | [email protected] "fn" | 304 | [email protected] |
327 | [email protected] " " | 305 | [email protected] "(" |
328 | [email protected] | 306 | [email protected] ")" |
329 | [email protected] "foo" | 307 | [email protected] " " |
330 | [email protected] | 308 | [email protected] |
331 | [email protected] "(" | 309 | [email protected] "{" |
332 | [email protected] ")" | 310 | [email protected] "\n" |
333 | [email protected] " " | 311 | [email protected] "}" |
334 | [email protected] | 312 | [email protected] "\n" |
335 | [email protected] "{" | 313 | [email protected] |
336 | [email protected] "\n" | 314 | [email protected] "fn" |
337 | [email protected] "}" | 315 | [email protected] " " |
338 | [email protected] "\n" | 316 | [email protected] |
339 | [email protected] | 317 | [email protected] "bar" |
340 | [email protected] "fn" | 318 | [email protected] |
341 | [email protected] " " | 319 | [email protected] "(" |
342 | [email protected] | 320 | [email protected] ")" |
343 | [email protected] "bar" | 321 | [email protected] " " |
344 | [email protected] | 322 | [email protected] |
345 | [email protected] "(" | 323 | [email protected] "{" |
346 | [email protected] ")" | 324 | [email protected] "\n" |
347 | [email protected] " " | 325 | [email protected] "}" |
348 | [email protected] | 326 | "#]], |
349 | [email protected] "{" | ||
350 | [email protected] "\n" | ||
351 | [email protected] "}" | ||
352 | "# | ||
353 | .trim(), | ||
354 | syn.trim() | ||
355 | ); | 327 | ); |
356 | } | 328 | } |
357 | } | 329 | } |
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index a01b49822..6735b6388 100644 --- a/crates/rust-analyzer/src/cli/analysis_bench.rs +++ b/crates/rust-analyzer/src/cli/analysis_bench.rs | |||
@@ -16,7 +16,10 @@ use ide_db::{ | |||
16 | }; | 16 | }; |
17 | use vfs::AbsPathBuf; | 17 | use vfs::AbsPathBuf; |
18 | 18 | ||
19 | use crate::cli::{load_cargo::load_cargo, print_memory_usage, Verbosity}; | 19 | use crate::cli::{ |
20 | load_cargo::{load_cargo, LoadCargoConfig}, | ||
21 | print_memory_usage, Verbosity, | ||
22 | }; | ||
20 | 23 | ||
21 | pub struct BenchCmd { | 24 | pub struct BenchCmd { |
22 | pub path: PathBuf, | 25 | pub path: PathBuf, |
@@ -59,7 +62,14 @@ impl BenchCmd { | |||
59 | 62 | ||
60 | let start = Instant::now(); | 63 | let start = Instant::now(); |
61 | eprint!("loading: "); | 64 | eprint!("loading: "); |
62 | let (mut host, vfs) = load_cargo(&self.path, self.load_output_dirs, self.with_proc_macro)?; | 65 | |
66 | let load_cargo_config = LoadCargoConfig { | ||
67 | cargo_config: Default::default(), | ||
68 | load_out_dirs_from_check: self.load_output_dirs, | ||
69 | with_proc_macro: self.with_proc_macro, | ||
70 | }; | ||
71 | |||
72 | let (mut host, vfs) = load_cargo(&self.path, &load_cargo_config)?; | ||
63 | eprintln!("{:?}\n", start.elapsed()); | 73 | eprintln!("{:?}\n", start.elapsed()); |
64 | 74 | ||
65 | let file_id = { | 75 | let file_id = { |
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs index 66416f709..3417af687 100644 --- a/crates/rust-analyzer/src/cli/analysis_stats.rs +++ b/crates/rust-analyzer/src/cli/analysis_stats.rs | |||
@@ -25,8 +25,10 @@ use stdx::format_to; | |||
25 | use syntax::AstNode; | 25 | use syntax::AstNode; |
26 | 26 | ||
27 | use crate::cli::{ | 27 | use crate::cli::{ |
28 | load_cargo::load_cargo, print_memory_usage, progress_report::ProgressReport, report_metric, | 28 | load_cargo::{load_cargo, LoadCargoConfig}, |
29 | Result, Verbosity, | 29 | print_memory_usage, |
30 | progress_report::ProgressReport, | ||
31 | report_metric, Result, Verbosity, | ||
30 | }; | 32 | }; |
31 | use profile::StopWatch; | 33 | use profile::StopWatch; |
32 | 34 | ||
@@ -57,7 +59,12 @@ impl AnalysisStatsCmd { | |||
57 | }; | 59 | }; |
58 | 60 | ||
59 | let mut db_load_sw = self.stop_watch(); | 61 | let mut db_load_sw = self.stop_watch(); |
60 | let (host, vfs) = load_cargo(&self.path, self.load_output_dirs, self.with_proc_macro)?; | 62 | let load_cargo_config = LoadCargoConfig { |
63 | cargo_config: Default::default(), | ||
64 | load_out_dirs_from_check: self.load_output_dirs, | ||
65 | with_proc_macro: self.with_proc_macro, | ||
66 | }; | ||
67 | let (host, vfs) = load_cargo(&self.path, &load_cargo_config)?; | ||
61 | let db = host.raw_database(); | 68 | let db = host.raw_database(); |
62 | eprintln!("{:<20} {}", "Database loaded:", db_load_sw.elapsed()); | 69 | eprintln!("{:<20} {}", "Database loaded:", db_load_sw.elapsed()); |
63 | 70 | ||
diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs index 0090fd2c2..c60374c24 100644 --- a/crates/rust-analyzer/src/cli/diagnostics.rs +++ b/crates/rust-analyzer/src/cli/diagnostics.rs | |||
@@ -10,7 +10,10 @@ use hir::{db::HirDatabase, Crate, Module}; | |||
10 | use ide::{DiagnosticsConfig, Severity}; | 10 | use ide::{DiagnosticsConfig, Severity}; |
11 | use ide_db::base_db::SourceDatabaseExt; | 11 | use ide_db::base_db::SourceDatabaseExt; |
12 | 12 | ||
13 | use crate::cli::{load_cargo::load_cargo, Result}; | 13 | use crate::cli::{ |
14 | load_cargo::{load_cargo, LoadCargoConfig}, | ||
15 | Result, | ||
16 | }; | ||
14 | 17 | ||
15 | fn all_modules(db: &dyn HirDatabase) -> Vec<Module> { | 18 | fn all_modules(db: &dyn HirDatabase) -> Vec<Module> { |
16 | let mut worklist: Vec<_> = | 19 | let mut worklist: Vec<_> = |
@@ -25,8 +28,17 @@ fn all_modules(db: &dyn HirDatabase) -> Vec<Module> { | |||
25 | modules | 28 | modules |
26 | } | 29 | } |
27 | 30 | ||
28 | pub fn diagnostics(path: &Path, load_output_dirs: bool, with_proc_macro: bool) -> Result<()> { | 31 | pub fn diagnostics( |
29 | let (host, _vfs) = load_cargo(path, load_output_dirs, with_proc_macro)?; | 32 | path: &Path, |
33 | load_out_dirs_from_check: bool, | ||
34 | with_proc_macro: bool, | ||
35 | ) -> Result<()> { | ||
36 | let load_cargo_config = LoadCargoConfig { | ||
37 | cargo_config: Default::default(), | ||
38 | load_out_dirs_from_check, | ||
39 | with_proc_macro, | ||
40 | }; | ||
41 | let (host, _vfs) = load_cargo(path, &load_cargo_config)?; | ||
30 | let db = host.raw_database(); | 42 | let db = host.raw_database(); |
31 | let analysis = host.analysis(); | 43 | let analysis = host.analysis(); |
32 | 44 | ||
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index e12e87180..cc63c6cc2 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs | |||
@@ -13,14 +13,16 @@ use vfs::{loader::Handle, AbsPath, AbsPathBuf}; | |||
13 | 13 | ||
14 | use crate::reload::{ProjectFolders, SourceRootConfig}; | 14 | use crate::reload::{ProjectFolders, SourceRootConfig}; |
15 | 15 | ||
16 | pub fn load_cargo( | 16 | pub struct LoadCargoConfig { |
17 | root: &Path, | 17 | pub cargo_config: CargoConfig, |
18 | load_out_dirs_from_check: bool, | 18 | pub load_out_dirs_from_check: bool, |
19 | with_proc_macro: bool, | 19 | pub with_proc_macro: bool, |
20 | ) -> Result<(AnalysisHost, vfs::Vfs)> { | 20 | } |
21 | |||
22 | pub fn load_cargo(root: &Path, config: &LoadCargoConfig) -> Result<(AnalysisHost, vfs::Vfs)> { | ||
21 | let root = AbsPathBuf::assert(std::env::current_dir()?.join(root)); | 23 | let root = AbsPathBuf::assert(std::env::current_dir()?.join(root)); |
22 | let root = ProjectManifest::discover_single(&root)?; | 24 | let root = ProjectManifest::discover_single(&root)?; |
23 | let ws = ProjectWorkspace::load(root, &CargoConfig::default(), &|_| {})?; | 25 | let ws = ProjectWorkspace::load(root, &config.cargo_config, &|_| {})?; |
24 | 26 | ||
25 | let (sender, receiver) = unbounded(); | 27 | let (sender, receiver) = unbounded(); |
26 | let mut vfs = vfs::Vfs::default(); | 28 | let mut vfs = vfs::Vfs::default(); |
@@ -30,14 +32,14 @@ pub fn load_cargo( | |||
30 | Box::new(loader) | 32 | Box::new(loader) |
31 | }; | 33 | }; |
32 | 34 | ||
33 | let proc_macro_client = if with_proc_macro { | 35 | let proc_macro_client = if config.with_proc_macro { |
34 | let path = std::env::current_exe()?; | 36 | let path = std::env::current_exe()?; |
35 | Some(ProcMacroClient::extern_process(path, &["proc-macro"]).unwrap()) | 37 | Some(ProcMacroClient::extern_process(path, &["proc-macro"]).unwrap()) |
36 | } else { | 38 | } else { |
37 | None | 39 | None |
38 | }; | 40 | }; |
39 | 41 | ||
40 | let build_data = if load_out_dirs_from_check { | 42 | let build_data = if config.load_out_dirs_from_check { |
41 | let mut collector = BuildDataCollector::default(); | 43 | let mut collector = BuildDataCollector::default(); |
42 | ws.collect_build_data_configs(&mut collector); | 44 | ws.collect_build_data_configs(&mut collector); |
43 | Some(collector.collect(&|_| {})?) | 45 | Some(collector.collect(&|_| {})?) |
@@ -116,7 +118,13 @@ mod tests { | |||
116 | #[test] | 118 | #[test] |
117 | fn test_loading_rust_analyzer() { | 119 | fn test_loading_rust_analyzer() { |
118 | let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); | 120 | let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); |
119 | let (host, _vfs) = load_cargo(path, false, false).unwrap(); | 121 | let load_cargo_config = LoadCargoConfig { |
122 | cargo_config: Default::default(), | ||
123 | load_out_dirs_from_check: false, | ||
124 | with_proc_macro: false, | ||
125 | }; | ||
126 | |||
127 | let (host, _vfs) = load_cargo(path, &load_cargo_config).unwrap(); | ||
120 | let n_crates = Crate::all(host.raw_database()).len(); | 128 | let n_crates = Crate::all(host.raw_database()).len(); |
121 | // RA has quite a few crates, but the exact count doesn't matter | 129 | // RA has quite a few crates, but the exact count doesn't matter |
122 | assert!(n_crates > 20); | 130 | assert!(n_crates > 20); |
diff --git a/crates/rust-analyzer/src/cli/ssr.rs b/crates/rust-analyzer/src/cli/ssr.rs index bbb550ec9..8729ff0d9 100644 --- a/crates/rust-analyzer/src/cli/ssr.rs +++ b/crates/rust-analyzer/src/cli/ssr.rs | |||
@@ -1,11 +1,19 @@ | |||
1 | //! Applies structured search replace rules from the command line. | 1 | //! Applies structured search replace rules from the command line. |
2 | 2 | ||
3 | use crate::cli::{load_cargo::load_cargo, Result}; | 3 | use crate::cli::{ |
4 | load_cargo::{load_cargo, LoadCargoConfig}, | ||
5 | Result, | ||
6 | }; | ||
4 | use ssr::{MatchFinder, SsrPattern, SsrRule}; | 7 | use ssr::{MatchFinder, SsrPattern, SsrRule}; |
5 | 8 | ||
6 | pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { | 9 | pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { |
7 | use ide_db::base_db::SourceDatabaseExt; | 10 | use ide_db::base_db::SourceDatabaseExt; |
8 | let (host, vfs) = load_cargo(&std::env::current_dir()?, true, true)?; | 11 | let load_cargo_config = LoadCargoConfig { |
12 | cargo_config: Default::default(), | ||
13 | load_out_dirs_from_check: true, | ||
14 | with_proc_macro: true, | ||
15 | }; | ||
16 | let (host, vfs) = load_cargo(&std::env::current_dir()?, &load_cargo_config)?; | ||
9 | let db = host.raw_database(); | 17 | let db = host.raw_database(); |
10 | let mut match_finder = MatchFinder::at_first_file(db)?; | 18 | let mut match_finder = MatchFinder::at_first_file(db)?; |
11 | for rule in rules { | 19 | for rule in rules { |
@@ -28,7 +36,12 @@ pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { | |||
28 | pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> { | 36 | pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> { |
29 | use ide_db::base_db::SourceDatabaseExt; | 37 | use ide_db::base_db::SourceDatabaseExt; |
30 | use ide_db::symbol_index::SymbolsDatabase; | 38 | use ide_db::symbol_index::SymbolsDatabase; |
31 | let (host, _vfs) = load_cargo(&std::env::current_dir()?, true, true)?; | 39 | let load_cargo_config = LoadCargoConfig { |
40 | cargo_config: Default::default(), | ||
41 | load_out_dirs_from_check: true, | ||
42 | with_proc_macro: true, | ||
43 | }; | ||
44 | let (host, _vfs) = load_cargo(&std::env::current_dir()?, &load_cargo_config)?; | ||
32 | let db = host.raw_database(); | 45 | let db = host.raw_database(); |
33 | let mut match_finder = MatchFinder::at_first_file(db)?; | 46 | let mut match_finder = MatchFinder::at_first_file(db)?; |
34 | for pattern in patterns { | 47 | for pattern in patterns { |
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index aa6f6e0b6..e3ef71650 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml | |||
@@ -13,7 +13,7 @@ doctest = false | |||
13 | [dependencies] | 13 | [dependencies] |
14 | itertools = "0.10.0" | 14 | itertools = "0.10.0" |
15 | rowan = "0.12.2" | 15 | rowan = "0.12.2" |
16 | rustc_lexer = { version = "702.0.0", package = "rustc-ap-rustc_lexer" } | 16 | rustc_lexer = { version = "705.0.0", package = "rustc-ap-rustc_lexer" } |
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
18 | arrayvec = "0.5.1" | 18 | arrayvec = "0.5.1" |
19 | once_cell = "1.3.1" | 19 | once_cell = "1.3.1" |
diff --git a/crates/syntax/src/tests.rs b/crates/syntax/src/tests.rs index 9d3433c9d..b2c06e24f 100644 --- a/crates/syntax/src/tests.rs +++ b/crates/syntax/src/tests.rs | |||
@@ -4,11 +4,12 @@ use std::{ | |||
4 | path::{Path, PathBuf}, | 4 | path::{Path, PathBuf}, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | use ast::NameOwner; | ||
7 | use expect_test::expect_file; | 8 | use expect_test::expect_file; |
8 | use rayon::prelude::*; | 9 | use rayon::prelude::*; |
9 | use test_utils::project_dir; | 10 | use test_utils::{bench, bench_fixture, project_dir, skip_slow_tests}; |
10 | 11 | ||
11 | use crate::{fuzz, tokenize, SourceFile, SyntaxError, TextRange, TextSize, Token}; | 12 | use crate::{ast, fuzz, tokenize, AstNode, SourceFile, SyntaxError, TextRange, TextSize, Token}; |
12 | 13 | ||
13 | #[test] | 14 | #[test] |
14 | fn lexer_tests() { | 15 | fn lexer_tests() { |
@@ -42,6 +43,28 @@ fn main() { | |||
42 | } | 43 | } |
43 | 44 | ||
44 | #[test] | 45 | #[test] |
46 | fn benchmark_parser() { | ||
47 | if skip_slow_tests() { | ||
48 | return; | ||
49 | } | ||
50 | let data = bench_fixture::glorious_old_parser(); | ||
51 | let tree = { | ||
52 | let _b = bench("parsing"); | ||
53 | let p = SourceFile::parse(&data); | ||
54 | assert!(p.errors.is_empty()); | ||
55 | assert_eq!(p.tree().syntax.text_range().len(), 352474.into()); | ||
56 | p.tree() | ||
57 | }; | ||
58 | |||
59 | { | ||
60 | let _b = bench("tree traversal"); | ||
61 | let fn_names = | ||
62 | tree.syntax().descendants().filter_map(ast::Fn::cast).filter_map(|f| f.name()).count(); | ||
63 | assert_eq!(fn_names, 268); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | #[test] | ||
45 | fn parser_tests() { | 68 | fn parser_tests() { |
46 | dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], "rast", |text, path| { | 69 | dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], "rast", |text, path| { |
47 | let parse = SourceFile::parse(text); | 70 | let parse = SourceFile::parse(text); |
@@ -128,7 +151,6 @@ fn reparse_fuzz_tests() { | |||
128 | } | 151 | } |
129 | 152 | ||
130 | /// Test that Rust-analyzer can parse and validate the rust-analyzer | 153 | /// Test that Rust-analyzer can parse and validate the rust-analyzer |
131 | /// FIXME: Use this as a benchmark | ||
132 | #[test] | 154 | #[test] |
133 | fn self_hosting_parsing() { | 155 | fn self_hosting_parsing() { |
134 | let dir = project_dir().join("crates"); | 156 | let dir = project_dir().join("crates"); |
diff --git a/crates/syntax/test_data/accidentally_quadratic b/crates/syntax/test_data/accidentally_quadratic deleted file mode 100644 index 428f83a62..000000000 --- a/crates/syntax/test_data/accidentally_quadratic +++ /dev/null | |||
@@ -1,3980 +0,0 @@ | |||
1 | #[doc = r" Register block"] | ||
2 | #[repr(C)] | ||
3 | pub struct RegisterBlock { | ||
4 | #[doc = "0x00 - Control Register"] | ||
5 | pub cr: CR, | ||
6 | #[doc = "0x04 - Error Status Register"] | ||
7 | pub es: ES, | ||
8 | _reserved0: [u8; 4usize], | ||
9 | #[doc = "0x0c - Enable Request Register"] | ||
10 | pub erq: ERQ, | ||
11 | _reserved1: [u8; 4usize], | ||
12 | #[doc = "0x14 - Enable Error Interrupt Register"] | ||
13 | pub eei: EEI, | ||
14 | #[doc = "0x18 - Clear Enable Error Interrupt Register"] | ||
15 | pub ceei: CEEI, | ||
16 | #[doc = "0x19 - Set Enable Error Interrupt Register"] | ||
17 | pub seei: SEEI, | ||
18 | #[doc = "0x1a - Clear Enable Request Register"] | ||
19 | pub cerq: CERQ, | ||
20 | #[doc = "0x1b - Set Enable Request Register"] | ||
21 | pub serq: SERQ, | ||
22 | #[doc = "0x1c - Clear DONE Status Bit Register"] | ||
23 | pub cdne: CDNE, | ||
24 | #[doc = "0x1d - Set START Bit Register"] | ||
25 | pub ssrt: SSRT, | ||
26 | #[doc = "0x1e - Clear Error Register"] | ||
27 | pub cerr: CERR, | ||
28 | #[doc = "0x1f - Clear Interrupt Request Register"] | ||
29 | pub cint: CINT, | ||
30 | _reserved2: [u8; 4usize], | ||
31 | #[doc = "0x24 - Interrupt Request Register"] | ||
32 | pub int: INT, | ||
33 | _reserved3: [u8; 4usize], | ||
34 | #[doc = "0x2c - Error Register"] | ||
35 | pub err: ERR, | ||
36 | _reserved4: [u8; 4usize], | ||
37 | #[doc = "0x34 - Hardware Request Status Register"] | ||
38 | pub hrs: HRS, | ||
39 | _reserved5: [u8; 12usize], | ||
40 | #[doc = "0x44 - Enable Asynchronous Request in Stop Register"] | ||
41 | pub ears: EARS, | ||
42 | _reserved6: [u8; 184usize], | ||
43 | #[doc = "0x100 - Channel n Priority Register"] | ||
44 | pub dchpri3: DCHPRI3, | ||
45 | #[doc = "0x101 - Channel n Priority Register"] | ||
46 | pub dchpri2: DCHPRI2, | ||
47 | #[doc = "0x102 - Channel n Priority Register"] | ||
48 | pub dchpri1: DCHPRI1, | ||
49 | #[doc = "0x103 - Channel n Priority Register"] | ||
50 | pub dchpri0: DCHPRI0, | ||
51 | #[doc = "0x104 - Channel n Priority Register"] | ||
52 | pub dchpri7: DCHPRI7, | ||
53 | #[doc = "0x105 - Channel n Priority Register"] | ||
54 | pub dchpri6: DCHPRI6, | ||
55 | #[doc = "0x106 - Channel n Priority Register"] | ||
56 | pub dchpri5: DCHPRI5, | ||
57 | #[doc = "0x107 - Channel n Priority Register"] | ||
58 | pub dchpri4: DCHPRI4, | ||
59 | #[doc = "0x108 - Channel n Priority Register"] | ||
60 | pub dchpri11: DCHPRI11, | ||
61 | #[doc = "0x109 - Channel n Priority Register"] | ||
62 | pub dchpri10: DCHPRI10, | ||
63 | #[doc = "0x10a - Channel n Priority Register"] | ||
64 | pub dchpri9: DCHPRI9, | ||
65 | #[doc = "0x10b - Channel n Priority Register"] | ||
66 | pub dchpri8: DCHPRI8, | ||
67 | #[doc = "0x10c - Channel n Priority Register"] | ||
68 | pub dchpri15: DCHPRI15, | ||
69 | #[doc = "0x10d - Channel n Priority Register"] | ||
70 | pub dchpri14: DCHPRI14, | ||
71 | #[doc = "0x10e - Channel n Priority Register"] | ||
72 | pub dchpri13: DCHPRI13, | ||
73 | #[doc = "0x10f - Channel n Priority Register"] | ||
74 | pub dchpri12: DCHPRI12, | ||
75 | #[doc = "0x110 - Channel n Priority Register"] | ||
76 | pub dchpri19: DCHPRI19, | ||
77 | #[doc = "0x111 - Channel n Priority Register"] | ||
78 | pub dchpri18: DCHPRI18, | ||
79 | #[doc = "0x112 - Channel n Priority Register"] | ||
80 | pub dchpri17: DCHPRI17, | ||
81 | #[doc = "0x113 - Channel n Priority Register"] | ||
82 | pub dchpri16: DCHPRI16, | ||
83 | #[doc = "0x114 - Channel n Priority Register"] | ||
84 | pub dchpri23: DCHPRI23, | ||
85 | #[doc = "0x115 - Channel n Priority Register"] | ||
86 | pub dchpri22: DCHPRI22, | ||
87 | #[doc = "0x116 - Channel n Priority Register"] | ||
88 | pub dchpri21: DCHPRI21, | ||
89 | #[doc = "0x117 - Channel n Priority Register"] | ||
90 | pub dchpri20: DCHPRI20, | ||
91 | #[doc = "0x118 - Channel n Priority Register"] | ||
92 | pub dchpri27: DCHPRI27, | ||
93 | #[doc = "0x119 - Channel n Priority Register"] | ||
94 | pub dchpri26: DCHPRI26, | ||
95 | #[doc = "0x11a - Channel n Priority Register"] | ||
96 | pub dchpri25: DCHPRI25, | ||
97 | #[doc = "0x11b - Channel n Priority Register"] | ||
98 | pub dchpri24: DCHPRI24, | ||
99 | #[doc = "0x11c - Channel n Priority Register"] | ||
100 | pub dchpri31: DCHPRI31, | ||
101 | #[doc = "0x11d - Channel n Priority Register"] | ||
102 | pub dchpri30: DCHPRI30, | ||
103 | #[doc = "0x11e - Channel n Priority Register"] | ||
104 | pub dchpri29: DCHPRI29, | ||
105 | #[doc = "0x11f - Channel n Priority Register"] | ||
106 | pub dchpri28: DCHPRI28, | ||
107 | _reserved7: [u8; 3808usize], | ||
108 | #[doc = "0x1000 - TCD Source Address"] | ||
109 | pub tcd0_saddr: TCD0_SADDR, | ||
110 | #[doc = "0x1004 - TCD Signed Source Address Offset"] | ||
111 | pub tcd0_soff: TCD0_SOFF, | ||
112 | #[doc = "0x1006 - TCD Transfer Attributes"] | ||
113 | pub tcd0_attr: TCD0_ATTR, | ||
114 | #[doc = "0x1008 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
115 | pub tcd0_nbytes_mlno: TCD0_NBYTES_MLNO, | ||
116 | #[doc = "0x100c - TCD Last Source Address Adjustment"] | ||
117 | pub tcd0_slast: TCD0_SLAST, | ||
118 | #[doc = "0x1010 - TCD Destination Address"] | ||
119 | pub tcd0_daddr: TCD0_DADDR, | ||
120 | #[doc = "0x1014 - TCD Signed Destination Address Offset"] | ||
121 | pub tcd0_doff: TCD0_DOFF, | ||
122 | #[doc = "0x1016 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
123 | pub tcd0_citer_elinkno: TCD0_CITER_ELINKNO, | ||
124 | #[doc = "0x1018 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
125 | pub tcd0_dlastsga: TCD0_DLASTSGA, | ||
126 | #[doc = "0x101c - TCD Control and Status"] | ||
127 | pub tcd0_csr: TCD0_CSR, | ||
128 | #[doc = "0x101e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
129 | pub tcd0_biter_elinkno: TCD0_BITER_ELINKNO, | ||
130 | #[doc = "0x1020 - TCD Source Address"] | ||
131 | pub tcd1_saddr: TCD1_SADDR, | ||
132 | #[doc = "0x1024 - TCD Signed Source Address Offset"] | ||
133 | pub tcd1_soff: TCD1_SOFF, | ||
134 | #[doc = "0x1026 - TCD Transfer Attributes"] | ||
135 | pub tcd1_attr: TCD1_ATTR, | ||
136 | #[doc = "0x1028 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
137 | pub tcd1_nbytes_mlno: TCD1_NBYTES_MLNO, | ||
138 | #[doc = "0x102c - TCD Last Source Address Adjustment"] | ||
139 | pub tcd1_slast: TCD1_SLAST, | ||
140 | #[doc = "0x1030 - TCD Destination Address"] | ||
141 | pub tcd1_daddr: TCD1_DADDR, | ||
142 | #[doc = "0x1034 - TCD Signed Destination Address Offset"] | ||
143 | pub tcd1_doff: TCD1_DOFF, | ||
144 | #[doc = "0x1036 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
145 | pub tcd1_citer_elinkno: TCD1_CITER_ELINKNO, | ||
146 | #[doc = "0x1038 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
147 | pub tcd1_dlastsga: TCD1_DLASTSGA, | ||
148 | #[doc = "0x103c - TCD Control and Status"] | ||
149 | pub tcd1_csr: TCD1_CSR, | ||
150 | #[doc = "0x103e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
151 | pub tcd1_biter_elinkno: TCD1_BITER_ELINKNO, | ||
152 | #[doc = "0x1040 - TCD Source Address"] | ||
153 | pub tcd2_saddr: TCD2_SADDR, | ||
154 | #[doc = "0x1044 - TCD Signed Source Address Offset"] | ||
155 | pub tcd2_soff: TCD2_SOFF, | ||
156 | #[doc = "0x1046 - TCD Transfer Attributes"] | ||
157 | pub tcd2_attr: TCD2_ATTR, | ||
158 | #[doc = "0x1048 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
159 | pub tcd2_nbytes_mlno: TCD2_NBYTES_MLNO, | ||
160 | #[doc = "0x104c - TCD Last Source Address Adjustment"] | ||
161 | pub tcd2_slast: TCD2_SLAST, | ||
162 | #[doc = "0x1050 - TCD Destination Address"] | ||
163 | pub tcd2_daddr: TCD2_DADDR, | ||
164 | #[doc = "0x1054 - TCD Signed Destination Address Offset"] | ||
165 | pub tcd2_doff: TCD2_DOFF, | ||
166 | #[doc = "0x1056 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
167 | pub tcd2_citer_elinkno: TCD2_CITER_ELINKNO, | ||
168 | #[doc = "0x1058 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
169 | pub tcd2_dlastsga: TCD2_DLASTSGA, | ||
170 | #[doc = "0x105c - TCD Control and Status"] | ||
171 | pub tcd2_csr: TCD2_CSR, | ||
172 | #[doc = "0x105e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
173 | pub tcd2_biter_elinkno: TCD2_BITER_ELINKNO, | ||
174 | #[doc = "0x1060 - TCD Source Address"] | ||
175 | pub tcd3_saddr: TCD3_SADDR, | ||
176 | #[doc = "0x1064 - TCD Signed Source Address Offset"] | ||
177 | pub tcd3_soff: TCD3_SOFF, | ||
178 | #[doc = "0x1066 - TCD Transfer Attributes"] | ||
179 | pub tcd3_attr: TCD3_ATTR, | ||
180 | #[doc = "0x1068 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
181 | pub tcd3_nbytes_mlno: TCD3_NBYTES_MLNO, | ||
182 | #[doc = "0x106c - TCD Last Source Address Adjustment"] | ||
183 | pub tcd3_slast: TCD3_SLAST, | ||
184 | #[doc = "0x1070 - TCD Destination Address"] | ||
185 | pub tcd3_daddr: TCD3_DADDR, | ||
186 | #[doc = "0x1074 - TCD Signed Destination Address Offset"] | ||
187 | pub tcd3_doff: TCD3_DOFF, | ||
188 | #[doc = "0x1076 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
189 | pub tcd3_citer_elinkno: TCD3_CITER_ELINKNO, | ||
190 | #[doc = "0x1078 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
191 | pub tcd3_dlastsga: TCD3_DLASTSGA, | ||
192 | #[doc = "0x107c - TCD Control and Status"] | ||
193 | pub tcd3_csr: TCD3_CSR, | ||
194 | #[doc = "0x107e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
195 | pub tcd3_biter_elinkno: TCD3_BITER_ELINKNO, | ||
196 | #[doc = "0x1080 - TCD Source Address"] | ||
197 | pub tcd4_saddr: TCD4_SADDR, | ||
198 | #[doc = "0x1084 - TCD Signed Source Address Offset"] | ||
199 | pub tcd4_soff: TCD4_SOFF, | ||
200 | #[doc = "0x1086 - TCD Transfer Attributes"] | ||
201 | pub tcd4_attr: TCD4_ATTR, | ||
202 | #[doc = "0x1088 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
203 | pub tcd4_nbytes_mlno: TCD4_NBYTES_MLNO, | ||
204 | #[doc = "0x108c - TCD Last Source Address Adjustment"] | ||
205 | pub tcd4_slast: TCD4_SLAST, | ||
206 | #[doc = "0x1090 - TCD Destination Address"] | ||
207 | pub tcd4_daddr: TCD4_DADDR, | ||
208 | #[doc = "0x1094 - TCD Signed Destination Address Offset"] | ||
209 | pub tcd4_doff: TCD4_DOFF, | ||
210 | #[doc = "0x1096 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
211 | pub tcd4_citer_elinkno: TCD4_CITER_ELINKNO, | ||
212 | #[doc = "0x1098 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
213 | pub tcd4_dlastsga: TCD4_DLASTSGA, | ||
214 | #[doc = "0x109c - TCD Control and Status"] | ||
215 | pub tcd4_csr: TCD4_CSR, | ||
216 | #[doc = "0x109e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
217 | pub tcd4_biter_elinkno: TCD4_BITER_ELINKNO, | ||
218 | #[doc = "0x10a0 - TCD Source Address"] | ||
219 | pub tcd5_saddr: TCD5_SADDR, | ||
220 | #[doc = "0x10a4 - TCD Signed Source Address Offset"] | ||
221 | pub tcd5_soff: TCD5_SOFF, | ||
222 | #[doc = "0x10a6 - TCD Transfer Attributes"] | ||
223 | pub tcd5_attr: TCD5_ATTR, | ||
224 | #[doc = "0x10a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
225 | pub tcd5_nbytes_mlno: TCD5_NBYTES_MLNO, | ||
226 | #[doc = "0x10ac - TCD Last Source Address Adjustment"] | ||
227 | pub tcd5_slast: TCD5_SLAST, | ||
228 | #[doc = "0x10b0 - TCD Destination Address"] | ||
229 | pub tcd5_daddr: TCD5_DADDR, | ||
230 | #[doc = "0x10b4 - TCD Signed Destination Address Offset"] | ||
231 | pub tcd5_doff: TCD5_DOFF, | ||
232 | #[doc = "0x10b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
233 | pub tcd5_citer_elinkno: TCD5_CITER_ELINKNO, | ||
234 | #[doc = "0x10b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
235 | pub tcd5_dlastsga: TCD5_DLASTSGA, | ||
236 | #[doc = "0x10bc - TCD Control and Status"] | ||
237 | pub tcd5_csr: TCD5_CSR, | ||
238 | #[doc = "0x10be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
239 | pub tcd5_biter_elinkno: TCD5_BITER_ELINKNO, | ||
240 | #[doc = "0x10c0 - TCD Source Address"] | ||
241 | pub tcd6_saddr: TCD6_SADDR, | ||
242 | #[doc = "0x10c4 - TCD Signed Source Address Offset"] | ||
243 | pub tcd6_soff: TCD6_SOFF, | ||
244 | #[doc = "0x10c6 - TCD Transfer Attributes"] | ||
245 | pub tcd6_attr: TCD6_ATTR, | ||
246 | #[doc = "0x10c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
247 | pub tcd6_nbytes_mlno: TCD6_NBYTES_MLNO, | ||
248 | #[doc = "0x10cc - TCD Last Source Address Adjustment"] | ||
249 | pub tcd6_slast: TCD6_SLAST, | ||
250 | #[doc = "0x10d0 - TCD Destination Address"] | ||
251 | pub tcd6_daddr: TCD6_DADDR, | ||
252 | #[doc = "0x10d4 - TCD Signed Destination Address Offset"] | ||
253 | pub tcd6_doff: TCD6_DOFF, | ||
254 | #[doc = "0x10d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
255 | pub tcd6_citer_elinkno: TCD6_CITER_ELINKNO, | ||
256 | #[doc = "0x10d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
257 | pub tcd6_dlastsga: TCD6_DLASTSGA, | ||
258 | #[doc = "0x10dc - TCD Control and Status"] | ||
259 | pub tcd6_csr: TCD6_CSR, | ||
260 | #[doc = "0x10de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
261 | pub tcd6_biter_elinkno: TCD6_BITER_ELINKNO, | ||
262 | #[doc = "0x10e0 - TCD Source Address"] | ||
263 | pub tcd7_saddr: TCD7_SADDR, | ||
264 | #[doc = "0x10e4 - TCD Signed Source Address Offset"] | ||
265 | pub tcd7_soff: TCD7_SOFF, | ||
266 | #[doc = "0x10e6 - TCD Transfer Attributes"] | ||
267 | pub tcd7_attr: TCD7_ATTR, | ||
268 | #[doc = "0x10e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
269 | pub tcd7_nbytes_mlno: TCD7_NBYTES_MLNO, | ||
270 | #[doc = "0x10ec - TCD Last Source Address Adjustment"] | ||
271 | pub tcd7_slast: TCD7_SLAST, | ||
272 | #[doc = "0x10f0 - TCD Destination Address"] | ||
273 | pub tcd7_daddr: TCD7_DADDR, | ||
274 | #[doc = "0x10f4 - TCD Signed Destination Address Offset"] | ||
275 | pub tcd7_doff: TCD7_DOFF, | ||
276 | #[doc = "0x10f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
277 | pub tcd7_citer_elinkno: TCD7_CITER_ELINKNO, | ||
278 | #[doc = "0x10f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
279 | pub tcd7_dlastsga: TCD7_DLASTSGA, | ||
280 | #[doc = "0x10fc - TCD Control and Status"] | ||
281 | pub tcd7_csr: TCD7_CSR, | ||
282 | #[doc = "0x10fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
283 | pub tcd7_biter_elinkno: TCD7_BITER_ELINKNO, | ||
284 | #[doc = "0x1100 - TCD Source Address"] | ||
285 | pub tcd8_saddr: TCD8_SADDR, | ||
286 | #[doc = "0x1104 - TCD Signed Source Address Offset"] | ||
287 | pub tcd8_soff: TCD8_SOFF, | ||
288 | #[doc = "0x1106 - TCD Transfer Attributes"] | ||
289 | pub tcd8_attr: TCD8_ATTR, | ||
290 | #[doc = "0x1108 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
291 | pub tcd8_nbytes_mlno: TCD8_NBYTES_MLNO, | ||
292 | #[doc = "0x110c - TCD Last Source Address Adjustment"] | ||
293 | pub tcd8_slast: TCD8_SLAST, | ||
294 | #[doc = "0x1110 - TCD Destination Address"] | ||
295 | pub tcd8_daddr: TCD8_DADDR, | ||
296 | #[doc = "0x1114 - TCD Signed Destination Address Offset"] | ||
297 | pub tcd8_doff: TCD8_DOFF, | ||
298 | #[doc = "0x1116 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
299 | pub tcd8_citer_elinkno: TCD8_CITER_ELINKNO, | ||
300 | #[doc = "0x1118 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
301 | pub tcd8_dlastsga: TCD8_DLASTSGA, | ||
302 | #[doc = "0x111c - TCD Control and Status"] | ||
303 | pub tcd8_csr: TCD8_CSR, | ||
304 | #[doc = "0x111e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
305 | pub tcd8_biter_elinkno: TCD8_BITER_ELINKNO, | ||
306 | #[doc = "0x1120 - TCD Source Address"] | ||
307 | pub tcd9_saddr: TCD9_SADDR, | ||
308 | #[doc = "0x1124 - TCD Signed Source Address Offset"] | ||
309 | pub tcd9_soff: TCD9_SOFF, | ||
310 | #[doc = "0x1126 - TCD Transfer Attributes"] | ||
311 | pub tcd9_attr: TCD9_ATTR, | ||
312 | #[doc = "0x1128 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
313 | pub tcd9_nbytes_mlno: TCD9_NBYTES_MLNO, | ||
314 | #[doc = "0x112c - TCD Last Source Address Adjustment"] | ||
315 | pub tcd9_slast: TCD9_SLAST, | ||
316 | #[doc = "0x1130 - TCD Destination Address"] | ||
317 | pub tcd9_daddr: TCD9_DADDR, | ||
318 | #[doc = "0x1134 - TCD Signed Destination Address Offset"] | ||
319 | pub tcd9_doff: TCD9_DOFF, | ||
320 | #[doc = "0x1136 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
321 | pub tcd9_citer_elinkno: TCD9_CITER_ELINKNO, | ||
322 | #[doc = "0x1138 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
323 | pub tcd9_dlastsga: TCD9_DLASTSGA, | ||
324 | #[doc = "0x113c - TCD Control and Status"] | ||
325 | pub tcd9_csr: TCD9_CSR, | ||
326 | #[doc = "0x113e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
327 | pub tcd9_biter_elinkno: TCD9_BITER_ELINKNO, | ||
328 | #[doc = "0x1140 - TCD Source Address"] | ||
329 | pub tcd10_saddr: TCD10_SADDR, | ||
330 | #[doc = "0x1144 - TCD Signed Source Address Offset"] | ||
331 | pub tcd10_soff: TCD10_SOFF, | ||
332 | #[doc = "0x1146 - TCD Transfer Attributes"] | ||
333 | pub tcd10_attr: TCD10_ATTR, | ||
334 | #[doc = "0x1148 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
335 | pub tcd10_nbytes_mlno: TCD10_NBYTES_MLNO, | ||
336 | #[doc = "0x114c - TCD Last Source Address Adjustment"] | ||
337 | pub tcd10_slast: TCD10_SLAST, | ||
338 | #[doc = "0x1150 - TCD Destination Address"] | ||
339 | pub tcd10_daddr: TCD10_DADDR, | ||
340 | #[doc = "0x1154 - TCD Signed Destination Address Offset"] | ||
341 | pub tcd10_doff: TCD10_DOFF, | ||
342 | #[doc = "0x1156 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
343 | pub tcd10_citer_elinkno: TCD10_CITER_ELINKNO, | ||
344 | #[doc = "0x1158 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
345 | pub tcd10_dlastsga: TCD10_DLASTSGA, | ||
346 | #[doc = "0x115c - TCD Control and Status"] | ||
347 | pub tcd10_csr: TCD10_CSR, | ||
348 | #[doc = "0x115e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
349 | pub tcd10_biter_elinkno: TCD10_BITER_ELINKNO, | ||
350 | #[doc = "0x1160 - TCD Source Address"] | ||
351 | pub tcd11_saddr: TCD11_SADDR, | ||
352 | #[doc = "0x1164 - TCD Signed Source Address Offset"] | ||
353 | pub tcd11_soff: TCD11_SOFF, | ||
354 | #[doc = "0x1166 - TCD Transfer Attributes"] | ||
355 | pub tcd11_attr: TCD11_ATTR, | ||
356 | #[doc = "0x1168 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
357 | pub tcd11_nbytes_mlno: TCD11_NBYTES_MLNO, | ||
358 | #[doc = "0x116c - TCD Last Source Address Adjustment"] | ||
359 | pub tcd11_slast: TCD11_SLAST, | ||
360 | #[doc = "0x1170 - TCD Destination Address"] | ||
361 | pub tcd11_daddr: TCD11_DADDR, | ||
362 | #[doc = "0x1174 - TCD Signed Destination Address Offset"] | ||
363 | pub tcd11_doff: TCD11_DOFF, | ||
364 | #[doc = "0x1176 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
365 | pub tcd11_citer_elinkno: TCD11_CITER_ELINKNO, | ||
366 | #[doc = "0x1178 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
367 | pub tcd11_dlastsga: TCD11_DLASTSGA, | ||
368 | #[doc = "0x117c - TCD Control and Status"] | ||
369 | pub tcd11_csr: TCD11_CSR, | ||
370 | #[doc = "0x117e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
371 | pub tcd11_biter_elinkno: TCD11_BITER_ELINKNO, | ||
372 | #[doc = "0x1180 - TCD Source Address"] | ||
373 | pub tcd12_saddr: TCD12_SADDR, | ||
374 | #[doc = "0x1184 - TCD Signed Source Address Offset"] | ||
375 | pub tcd12_soff: TCD12_SOFF, | ||
376 | #[doc = "0x1186 - TCD Transfer Attributes"] | ||
377 | pub tcd12_attr: TCD12_ATTR, | ||
378 | #[doc = "0x1188 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
379 | pub tcd12_nbytes_mlno: TCD12_NBYTES_MLNO, | ||
380 | #[doc = "0x118c - TCD Last Source Address Adjustment"] | ||
381 | pub tcd12_slast: TCD12_SLAST, | ||
382 | #[doc = "0x1190 - TCD Destination Address"] | ||
383 | pub tcd12_daddr: TCD12_DADDR, | ||
384 | #[doc = "0x1194 - TCD Signed Destination Address Offset"] | ||
385 | pub tcd12_doff: TCD12_DOFF, | ||
386 | #[doc = "0x1196 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
387 | pub tcd12_citer_elinkno: TCD12_CITER_ELINKNO, | ||
388 | #[doc = "0x1198 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
389 | pub tcd12_dlastsga: TCD12_DLASTSGA, | ||
390 | #[doc = "0x119c - TCD Control and Status"] | ||
391 | pub tcd12_csr: TCD12_CSR, | ||
392 | #[doc = "0x119e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
393 | pub tcd12_biter_elinkno: TCD12_BITER_ELINKNO, | ||
394 | #[doc = "0x11a0 - TCD Source Address"] | ||
395 | pub tcd13_saddr: TCD13_SADDR, | ||
396 | #[doc = "0x11a4 - TCD Signed Source Address Offset"] | ||
397 | pub tcd13_soff: TCD13_SOFF, | ||
398 | #[doc = "0x11a6 - TCD Transfer Attributes"] | ||
399 | pub tcd13_attr: TCD13_ATTR, | ||
400 | #[doc = "0x11a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
401 | pub tcd13_nbytes_mlno: TCD13_NBYTES_MLNO, | ||
402 | #[doc = "0x11ac - TCD Last Source Address Adjustment"] | ||
403 | pub tcd13_slast: TCD13_SLAST, | ||
404 | #[doc = "0x11b0 - TCD Destination Address"] | ||
405 | pub tcd13_daddr: TCD13_DADDR, | ||
406 | #[doc = "0x11b4 - TCD Signed Destination Address Offset"] | ||
407 | pub tcd13_doff: TCD13_DOFF, | ||
408 | #[doc = "0x11b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
409 | pub tcd13_citer_elinkno: TCD13_CITER_ELINKNO, | ||
410 | #[doc = "0x11b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
411 | pub tcd13_dlastsga: TCD13_DLASTSGA, | ||
412 | #[doc = "0x11bc - TCD Control and Status"] | ||
413 | pub tcd13_csr: TCD13_CSR, | ||
414 | #[doc = "0x11be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
415 | pub tcd13_biter_elinkno: TCD13_BITER_ELINKNO, | ||
416 | #[doc = "0x11c0 - TCD Source Address"] | ||
417 | pub tcd14_saddr: TCD14_SADDR, | ||
418 | #[doc = "0x11c4 - TCD Signed Source Address Offset"] | ||
419 | pub tcd14_soff: TCD14_SOFF, | ||
420 | #[doc = "0x11c6 - TCD Transfer Attributes"] | ||
421 | pub tcd14_attr: TCD14_ATTR, | ||
422 | #[doc = "0x11c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
423 | pub tcd14_nbytes_mlno: TCD14_NBYTES_MLNO, | ||
424 | #[doc = "0x11cc - TCD Last Source Address Adjustment"] | ||
425 | pub tcd14_slast: TCD14_SLAST, | ||
426 | #[doc = "0x11d0 - TCD Destination Address"] | ||
427 | pub tcd14_daddr: TCD14_DADDR, | ||
428 | #[doc = "0x11d4 - TCD Signed Destination Address Offset"] | ||
429 | pub tcd14_doff: TCD14_DOFF, | ||
430 | #[doc = "0x11d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
431 | pub tcd14_citer_elinkno: TCD14_CITER_ELINKNO, | ||
432 | #[doc = "0x11d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
433 | pub tcd14_dlastsga: TCD14_DLASTSGA, | ||
434 | #[doc = "0x11dc - TCD Control and Status"] | ||
435 | pub tcd14_csr: TCD14_CSR, | ||
436 | #[doc = "0x11de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
437 | pub tcd14_biter_elinkno: TCD14_BITER_ELINKNO, | ||
438 | #[doc = "0x11e0 - TCD Source Address"] | ||
439 | pub tcd15_saddr: TCD15_SADDR, | ||
440 | #[doc = "0x11e4 - TCD Signed Source Address Offset"] | ||
441 | pub tcd15_soff: TCD15_SOFF, | ||
442 | #[doc = "0x11e6 - TCD Transfer Attributes"] | ||
443 | pub tcd15_attr: TCD15_ATTR, | ||
444 | #[doc = "0x11e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
445 | pub tcd15_nbytes_mlno: TCD15_NBYTES_MLNO, | ||
446 | #[doc = "0x11ec - TCD Last Source Address Adjustment"] | ||
447 | pub tcd15_slast: TCD15_SLAST, | ||
448 | #[doc = "0x11f0 - TCD Destination Address"] | ||
449 | pub tcd15_daddr: TCD15_DADDR, | ||
450 | #[doc = "0x11f4 - TCD Signed Destination Address Offset"] | ||
451 | pub tcd15_doff: TCD15_DOFF, | ||
452 | #[doc = "0x11f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
453 | pub tcd15_citer_elinkno: TCD15_CITER_ELINKNO, | ||
454 | #[doc = "0x11f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
455 | pub tcd15_dlastsga: TCD15_DLASTSGA, | ||
456 | #[doc = "0x11fc - TCD Control and Status"] | ||
457 | pub tcd15_csr: TCD15_CSR, | ||
458 | #[doc = "0x11fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
459 | pub tcd15_biter_elinkno: TCD15_BITER_ELINKNO, | ||
460 | #[doc = "0x1200 - TCD Source Address"] | ||
461 | pub tcd16_saddr: TCD16_SADDR, | ||
462 | #[doc = "0x1204 - TCD Signed Source Address Offset"] | ||
463 | pub tcd16_soff: TCD16_SOFF, | ||
464 | #[doc = "0x1206 - TCD Transfer Attributes"] | ||
465 | pub tcd16_attr: TCD16_ATTR, | ||
466 | #[doc = "0x1208 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
467 | pub tcd16_nbytes_mlno: TCD16_NBYTES_MLNO, | ||
468 | #[doc = "0x120c - TCD Last Source Address Adjustment"] | ||
469 | pub tcd16_slast: TCD16_SLAST, | ||
470 | #[doc = "0x1210 - TCD Destination Address"] | ||
471 | pub tcd16_daddr: TCD16_DADDR, | ||
472 | #[doc = "0x1214 - TCD Signed Destination Address Offset"] | ||
473 | pub tcd16_doff: TCD16_DOFF, | ||
474 | #[doc = "0x1216 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
475 | pub tcd16_citer_elinkno: TCD16_CITER_ELINKNO, | ||
476 | #[doc = "0x1218 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
477 | pub tcd16_dlastsga: TCD16_DLASTSGA, | ||
478 | #[doc = "0x121c - TCD Control and Status"] | ||
479 | pub tcd16_csr: TCD16_CSR, | ||
480 | #[doc = "0x121e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
481 | pub tcd16_biter_elinkno: TCD16_BITER_ELINKNO, | ||
482 | #[doc = "0x1220 - TCD Source Address"] | ||
483 | pub tcd17_saddr: TCD17_SADDR, | ||
484 | #[doc = "0x1224 - TCD Signed Source Address Offset"] | ||
485 | pub tcd17_soff: TCD17_SOFF, | ||
486 | #[doc = "0x1226 - TCD Transfer Attributes"] | ||
487 | pub tcd17_attr: TCD17_ATTR, | ||
488 | #[doc = "0x1228 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
489 | pub tcd17_nbytes_mlno: TCD17_NBYTES_MLNO, | ||
490 | #[doc = "0x122c - TCD Last Source Address Adjustment"] | ||
491 | pub tcd17_slast: TCD17_SLAST, | ||
492 | #[doc = "0x1230 - TCD Destination Address"] | ||
493 | pub tcd17_daddr: TCD17_DADDR, | ||
494 | #[doc = "0x1234 - TCD Signed Destination Address Offset"] | ||
495 | pub tcd17_doff: TCD17_DOFF, | ||
496 | #[doc = "0x1236 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
497 | pub tcd17_citer_elinkno: TCD17_CITER_ELINKNO, | ||
498 | #[doc = "0x1238 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
499 | pub tcd17_dlastsga: TCD17_DLASTSGA, | ||
500 | #[doc = "0x123c - TCD Control and Status"] | ||
501 | pub tcd17_csr: TCD17_CSR, | ||
502 | #[doc = "0x123e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
503 | pub tcd17_biter_elinkno: TCD17_BITER_ELINKNO, | ||
504 | #[doc = "0x1240 - TCD Source Address"] | ||
505 | pub tcd18_saddr: TCD18_SADDR, | ||
506 | #[doc = "0x1244 - TCD Signed Source Address Offset"] | ||
507 | pub tcd18_soff: TCD18_SOFF, | ||
508 | #[doc = "0x1246 - TCD Transfer Attributes"] | ||
509 | pub tcd18_attr: TCD18_ATTR, | ||
510 | #[doc = "0x1248 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
511 | pub tcd18_nbytes_mlno: TCD18_NBYTES_MLNO, | ||
512 | #[doc = "0x124c - TCD Last Source Address Adjustment"] | ||
513 | pub tcd18_slast: TCD18_SLAST, | ||
514 | #[doc = "0x1250 - TCD Destination Address"] | ||
515 | pub tcd18_daddr: TCD18_DADDR, | ||
516 | #[doc = "0x1254 - TCD Signed Destination Address Offset"] | ||
517 | pub tcd18_doff: TCD18_DOFF, | ||
518 | #[doc = "0x1256 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
519 | pub tcd18_citer_elinkno: TCD18_CITER_ELINKNO, | ||
520 | #[doc = "0x1258 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
521 | pub tcd18_dlastsga: TCD18_DLASTSGA, | ||
522 | #[doc = "0x125c - TCD Control and Status"] | ||
523 | pub tcd18_csr: TCD18_CSR, | ||
524 | #[doc = "0x125e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
525 | pub tcd18_biter_elinkno: TCD18_BITER_ELINKNO, | ||
526 | #[doc = "0x1260 - TCD Source Address"] | ||
527 | pub tcd19_saddr: TCD19_SADDR, | ||
528 | #[doc = "0x1264 - TCD Signed Source Address Offset"] | ||
529 | pub tcd19_soff: TCD19_SOFF, | ||
530 | #[doc = "0x1266 - TCD Transfer Attributes"] | ||
531 | pub tcd19_attr: TCD19_ATTR, | ||
532 | #[doc = "0x1268 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
533 | pub tcd19_nbytes_mlno: TCD19_NBYTES_MLNO, | ||
534 | #[doc = "0x126c - TCD Last Source Address Adjustment"] | ||
535 | pub tcd19_slast: TCD19_SLAST, | ||
536 | #[doc = "0x1270 - TCD Destination Address"] | ||
537 | pub tcd19_daddr: TCD19_DADDR, | ||
538 | #[doc = "0x1274 - TCD Signed Destination Address Offset"] | ||
539 | pub tcd19_doff: TCD19_DOFF, | ||
540 | #[doc = "0x1276 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
541 | pub tcd19_citer_elinkno: TCD19_CITER_ELINKNO, | ||
542 | #[doc = "0x1278 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
543 | pub tcd19_dlastsga: TCD19_DLASTSGA, | ||
544 | #[doc = "0x127c - TCD Control and Status"] | ||
545 | pub tcd19_csr: TCD19_CSR, | ||
546 | #[doc = "0x127e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
547 | pub tcd19_biter_elinkno: TCD19_BITER_ELINKNO, | ||
548 | #[doc = "0x1280 - TCD Source Address"] | ||
549 | pub tcd20_saddr: TCD20_SADDR, | ||
550 | #[doc = "0x1284 - TCD Signed Source Address Offset"] | ||
551 | pub tcd20_soff: TCD20_SOFF, | ||
552 | #[doc = "0x1286 - TCD Transfer Attributes"] | ||
553 | pub tcd20_attr: TCD20_ATTR, | ||
554 | #[doc = "0x1288 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
555 | pub tcd20_nbytes_mlno: TCD20_NBYTES_MLNO, | ||
556 | #[doc = "0x128c - TCD Last Source Address Adjustment"] | ||
557 | pub tcd20_slast: TCD20_SLAST, | ||
558 | #[doc = "0x1290 - TCD Destination Address"] | ||
559 | pub tcd20_daddr: TCD20_DADDR, | ||
560 | #[doc = "0x1294 - TCD Signed Destination Address Offset"] | ||
561 | pub tcd20_doff: TCD20_DOFF, | ||
562 | #[doc = "0x1296 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
563 | pub tcd20_citer_elinkno: TCD20_CITER_ELINKNO, | ||
564 | #[doc = "0x1298 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
565 | pub tcd20_dlastsga: TCD20_DLASTSGA, | ||
566 | #[doc = "0x129c - TCD Control and Status"] | ||
567 | pub tcd20_csr: TCD20_CSR, | ||
568 | #[doc = "0x129e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
569 | pub tcd20_biter_elinkno: TCD20_BITER_ELINKNO, | ||
570 | #[doc = "0x12a0 - TCD Source Address"] | ||
571 | pub tcd21_saddr: TCD21_SADDR, | ||
572 | #[doc = "0x12a4 - TCD Signed Source Address Offset"] | ||
573 | pub tcd21_soff: TCD21_SOFF, | ||
574 | #[doc = "0x12a6 - TCD Transfer Attributes"] | ||
575 | pub tcd21_attr: TCD21_ATTR, | ||
576 | #[doc = "0x12a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
577 | pub tcd21_nbytes_mlno: TCD21_NBYTES_MLNO, | ||
578 | #[doc = "0x12ac - TCD Last Source Address Adjustment"] | ||
579 | pub tcd21_slast: TCD21_SLAST, | ||
580 | #[doc = "0x12b0 - TCD Destination Address"] | ||
581 | pub tcd21_daddr: TCD21_DADDR, | ||
582 | #[doc = "0x12b4 - TCD Signed Destination Address Offset"] | ||
583 | pub tcd21_doff: TCD21_DOFF, | ||
584 | #[doc = "0x12b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
585 | pub tcd21_citer_elinkno: TCD21_CITER_ELINKNO, | ||
586 | #[doc = "0x12b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
587 | pub tcd21_dlastsga: TCD21_DLASTSGA, | ||
588 | #[doc = "0x12bc - TCD Control and Status"] | ||
589 | pub tcd21_csr: TCD21_CSR, | ||
590 | #[doc = "0x12be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
591 | pub tcd21_biter_elinkno: TCD21_BITER_ELINKNO, | ||
592 | #[doc = "0x12c0 - TCD Source Address"] | ||
593 | pub tcd22_saddr: TCD22_SADDR, | ||
594 | #[doc = "0x12c4 - TCD Signed Source Address Offset"] | ||
595 | pub tcd22_soff: TCD22_SOFF, | ||
596 | #[doc = "0x12c6 - TCD Transfer Attributes"] | ||
597 | pub tcd22_attr: TCD22_ATTR, | ||
598 | #[doc = "0x12c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
599 | pub tcd22_nbytes_mlno: TCD22_NBYTES_MLNO, | ||
600 | #[doc = "0x12cc - TCD Last Source Address Adjustment"] | ||
601 | pub tcd22_slast: TCD22_SLAST, | ||
602 | #[doc = "0x12d0 - TCD Destination Address"] | ||
603 | pub tcd22_daddr: TCD22_DADDR, | ||
604 | #[doc = "0x12d4 - TCD Signed Destination Address Offset"] | ||
605 | pub tcd22_doff: TCD22_DOFF, | ||
606 | #[doc = "0x12d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
607 | pub tcd22_citer_elinkno: TCD22_CITER_ELINKNO, | ||
608 | #[doc = "0x12d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
609 | pub tcd22_dlastsga: TCD22_DLASTSGA, | ||
610 | #[doc = "0x12dc - TCD Control and Status"] | ||
611 | pub tcd22_csr: TCD22_CSR, | ||
612 | #[doc = "0x12de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
613 | pub tcd22_biter_elinkno: TCD22_BITER_ELINKNO, | ||
614 | #[doc = "0x12e0 - TCD Source Address"] | ||
615 | pub tcd23_saddr: TCD23_SADDR, | ||
616 | #[doc = "0x12e4 - TCD Signed Source Address Offset"] | ||
617 | pub tcd23_soff: TCD23_SOFF, | ||
618 | #[doc = "0x12e6 - TCD Transfer Attributes"] | ||
619 | pub tcd23_attr: TCD23_ATTR, | ||
620 | #[doc = "0x12e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
621 | pub tcd23_nbytes_mlno: TCD23_NBYTES_MLNO, | ||
622 | #[doc = "0x12ec - TCD Last Source Address Adjustment"] | ||
623 | pub tcd23_slast: TCD23_SLAST, | ||
624 | #[doc = "0x12f0 - TCD Destination Address"] | ||
625 | pub tcd23_daddr: TCD23_DADDR, | ||
626 | #[doc = "0x12f4 - TCD Signed Destination Address Offset"] | ||
627 | pub tcd23_doff: TCD23_DOFF, | ||
628 | #[doc = "0x12f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
629 | pub tcd23_citer_elinkno: TCD23_CITER_ELINKNO, | ||
630 | #[doc = "0x12f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
631 | pub tcd23_dlastsga: TCD23_DLASTSGA, | ||
632 | #[doc = "0x12fc - TCD Control and Status"] | ||
633 | pub tcd23_csr: TCD23_CSR, | ||
634 | #[doc = "0x12fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
635 | pub tcd23_biter_elinkno: TCD23_BITER_ELINKNO, | ||
636 | #[doc = "0x1300 - TCD Source Address"] | ||
637 | pub tcd24_saddr: TCD24_SADDR, | ||
638 | #[doc = "0x1304 - TCD Signed Source Address Offset"] | ||
639 | pub tcd24_soff: TCD24_SOFF, | ||
640 | #[doc = "0x1306 - TCD Transfer Attributes"] | ||
641 | pub tcd24_attr: TCD24_ATTR, | ||
642 | #[doc = "0x1308 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
643 | pub tcd24_nbytes_mlno: TCD24_NBYTES_MLNO, | ||
644 | #[doc = "0x130c - TCD Last Source Address Adjustment"] | ||
645 | pub tcd24_slast: TCD24_SLAST, | ||
646 | #[doc = "0x1310 - TCD Destination Address"] | ||
647 | pub tcd24_daddr: TCD24_DADDR, | ||
648 | #[doc = "0x1314 - TCD Signed Destination Address Offset"] | ||
649 | pub tcd24_doff: TCD24_DOFF, | ||
650 | #[doc = "0x1316 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
651 | pub tcd24_citer_elinkno: TCD24_CITER_ELINKNO, | ||
652 | #[doc = "0x1318 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
653 | pub tcd24_dlastsga: TCD24_DLASTSGA, | ||
654 | #[doc = "0x131c - TCD Control and Status"] | ||
655 | pub tcd24_csr: TCD24_CSR, | ||
656 | #[doc = "0x131e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
657 | pub tcd24_biter_elinkno: TCD24_BITER_ELINKNO, | ||
658 | #[doc = "0x1320 - TCD Source Address"] | ||
659 | pub tcd25_saddr: TCD25_SADDR, | ||
660 | #[doc = "0x1324 - TCD Signed Source Address Offset"] | ||
661 | pub tcd25_soff: TCD25_SOFF, | ||
662 | #[doc = "0x1326 - TCD Transfer Attributes"] | ||
663 | pub tcd25_attr: TCD25_ATTR, | ||
664 | #[doc = "0x1328 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
665 | pub tcd25_nbytes_mlno: TCD25_NBYTES_MLNO, | ||
666 | #[doc = "0x132c - TCD Last Source Address Adjustment"] | ||
667 | pub tcd25_slast: TCD25_SLAST, | ||
668 | #[doc = "0x1330 - TCD Destination Address"] | ||
669 | pub tcd25_daddr: TCD25_DADDR, | ||
670 | #[doc = "0x1334 - TCD Signed Destination Address Offset"] | ||
671 | pub tcd25_doff: TCD25_DOFF, | ||
672 | #[doc = "0x1336 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
673 | pub tcd25_citer_elinkno: TCD25_CITER_ELINKNO, | ||
674 | #[doc = "0x1338 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
675 | pub tcd25_dlastsga: TCD25_DLASTSGA, | ||
676 | #[doc = "0x133c - TCD Control and Status"] | ||
677 | pub tcd25_csr: TCD25_CSR, | ||
678 | #[doc = "0x133e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
679 | pub tcd25_biter_elinkno: TCD25_BITER_ELINKNO, | ||
680 | #[doc = "0x1340 - TCD Source Address"] | ||
681 | pub tcd26_saddr: TCD26_SADDR, | ||
682 | #[doc = "0x1344 - TCD Signed Source Address Offset"] | ||
683 | pub tcd26_soff: TCD26_SOFF, | ||
684 | #[doc = "0x1346 - TCD Transfer Attributes"] | ||
685 | pub tcd26_attr: TCD26_ATTR, | ||
686 | #[doc = "0x1348 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
687 | pub tcd26_nbytes_mlno: TCD26_NBYTES_MLNO, | ||
688 | #[doc = "0x134c - TCD Last Source Address Adjustment"] | ||
689 | pub tcd26_slast: TCD26_SLAST, | ||
690 | #[doc = "0x1350 - TCD Destination Address"] | ||
691 | pub tcd26_daddr: TCD26_DADDR, | ||
692 | #[doc = "0x1354 - TCD Signed Destination Address Offset"] | ||
693 | pub tcd26_doff: TCD26_DOFF, | ||
694 | #[doc = "0x1356 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
695 | pub tcd26_citer_elinkno: TCD26_CITER_ELINKNO, | ||
696 | #[doc = "0x1358 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
697 | pub tcd26_dlastsga: TCD26_DLASTSGA, | ||
698 | #[doc = "0x135c - TCD Control and Status"] | ||
699 | pub tcd26_csr: TCD26_CSR, | ||
700 | #[doc = "0x135e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
701 | pub tcd26_biter_elinkno: TCD26_BITER_ELINKNO, | ||
702 | #[doc = "0x1360 - TCD Source Address"] | ||
703 | pub tcd27_saddr: TCD27_SADDR, | ||
704 | #[doc = "0x1364 - TCD Signed Source Address Offset"] | ||
705 | pub tcd27_soff: TCD27_SOFF, | ||
706 | #[doc = "0x1366 - TCD Transfer Attributes"] | ||
707 | pub tcd27_attr: TCD27_ATTR, | ||
708 | #[doc = "0x1368 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
709 | pub tcd27_nbytes_mlno: TCD27_NBYTES_MLNO, | ||
710 | #[doc = "0x136c - TCD Last Source Address Adjustment"] | ||
711 | pub tcd27_slast: TCD27_SLAST, | ||
712 | #[doc = "0x1370 - TCD Destination Address"] | ||
713 | pub tcd27_daddr: TCD27_DADDR, | ||
714 | #[doc = "0x1374 - TCD Signed Destination Address Offset"] | ||
715 | pub tcd27_doff: TCD27_DOFF, | ||
716 | #[doc = "0x1376 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
717 | pub tcd27_citer_elinkno: TCD27_CITER_ELINKNO, | ||
718 | #[doc = "0x1378 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
719 | pub tcd27_dlastsga: TCD27_DLASTSGA, | ||
720 | #[doc = "0x137c - TCD Control and Status"] | ||
721 | pub tcd27_csr: TCD27_CSR, | ||
722 | #[doc = "0x137e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
723 | pub tcd27_biter_elinkno: TCD27_BITER_ELINKNO, | ||
724 | #[doc = "0x1380 - TCD Source Address"] | ||
725 | pub tcd28_saddr: TCD28_SADDR, | ||
726 | #[doc = "0x1384 - TCD Signed Source Address Offset"] | ||
727 | pub tcd28_soff: TCD28_SOFF, | ||
728 | #[doc = "0x1386 - TCD Transfer Attributes"] | ||
729 | pub tcd28_attr: TCD28_ATTR, | ||
730 | #[doc = "0x1388 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
731 | pub tcd28_nbytes_mlno: TCD28_NBYTES_MLNO, | ||
732 | #[doc = "0x138c - TCD Last Source Address Adjustment"] | ||
733 | pub tcd28_slast: TCD28_SLAST, | ||
734 | #[doc = "0x1390 - TCD Destination Address"] | ||
735 | pub tcd28_daddr: TCD28_DADDR, | ||
736 | #[doc = "0x1394 - TCD Signed Destination Address Offset"] | ||
737 | pub tcd28_doff: TCD28_DOFF, | ||
738 | #[doc = "0x1396 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
739 | pub tcd28_citer_elinkno: TCD28_CITER_ELINKNO, | ||
740 | #[doc = "0x1398 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
741 | pub tcd28_dlastsga: TCD28_DLASTSGA, | ||
742 | #[doc = "0x139c - TCD Control and Status"] | ||
743 | pub tcd28_csr: TCD28_CSR, | ||
744 | #[doc = "0x139e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
745 | pub tcd28_biter_elinkno: TCD28_BITER_ELINKNO, | ||
746 | #[doc = "0x13a0 - TCD Source Address"] | ||
747 | pub tcd29_saddr: TCD29_SADDR, | ||
748 | #[doc = "0x13a4 - TCD Signed Source Address Offset"] | ||
749 | pub tcd29_soff: TCD29_SOFF, | ||
750 | #[doc = "0x13a6 - TCD Transfer Attributes"] | ||
751 | pub tcd29_attr: TCD29_ATTR, | ||
752 | #[doc = "0x13a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
753 | pub tcd29_nbytes_mlno: TCD29_NBYTES_MLNO, | ||
754 | #[doc = "0x13ac - TCD Last Source Address Adjustment"] | ||
755 | pub tcd29_slast: TCD29_SLAST, | ||
756 | #[doc = "0x13b0 - TCD Destination Address"] | ||
757 | pub tcd29_daddr: TCD29_DADDR, | ||
758 | #[doc = "0x13b4 - TCD Signed Destination Address Offset"] | ||
759 | pub tcd29_doff: TCD29_DOFF, | ||
760 | #[doc = "0x13b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
761 | pub tcd29_citer_elinkno: TCD29_CITER_ELINKNO, | ||
762 | #[doc = "0x13b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
763 | pub tcd29_dlastsga: TCD29_DLASTSGA, | ||
764 | #[doc = "0x13bc - TCD Control and Status"] | ||
765 | pub tcd29_csr: TCD29_CSR, | ||
766 | #[doc = "0x13be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
767 | pub tcd29_biter_elinkno: TCD29_BITER_ELINKNO, | ||
768 | #[doc = "0x13c0 - TCD Source Address"] | ||
769 | pub tcd30_saddr: TCD30_SADDR, | ||
770 | #[doc = "0x13c4 - TCD Signed Source Address Offset"] | ||
771 | pub tcd30_soff: TCD30_SOFF, | ||
772 | #[doc = "0x13c6 - TCD Transfer Attributes"] | ||
773 | pub tcd30_attr: TCD30_ATTR, | ||
774 | #[doc = "0x13c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
775 | pub tcd30_nbytes_mlno: TCD30_NBYTES_MLNO, | ||
776 | #[doc = "0x13cc - TCD Last Source Address Adjustment"] | ||
777 | pub tcd30_slast: TCD30_SLAST, | ||
778 | #[doc = "0x13d0 - TCD Destination Address"] | ||
779 | pub tcd30_daddr: TCD30_DADDR, | ||
780 | #[doc = "0x13d4 - TCD Signed Destination Address Offset"] | ||
781 | pub tcd30_doff: TCD30_DOFF, | ||
782 | #[doc = "0x13d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
783 | pub tcd30_citer_elinkno: TCD30_CITER_ELINKNO, | ||
784 | #[doc = "0x13d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
785 | pub tcd30_dlastsga: TCD30_DLASTSGA, | ||
786 | #[doc = "0x13dc - TCD Control and Status"] | ||
787 | pub tcd30_csr: TCD30_CSR, | ||
788 | #[doc = "0x13de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
789 | pub tcd30_biter_elinkno: TCD30_BITER_ELINKNO, | ||
790 | #[doc = "0x13e0 - TCD Source Address"] | ||
791 | pub tcd31_saddr: TCD31_SADDR, | ||
792 | #[doc = "0x13e4 - TCD Signed Source Address Offset"] | ||
793 | pub tcd31_soff: TCD31_SOFF, | ||
794 | #[doc = "0x13e6 - TCD Transfer Attributes"] | ||
795 | pub tcd31_attr: TCD31_ATTR, | ||
796 | #[doc = "0x13e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
797 | pub tcd31_nbytes_mlno: TCD31_NBYTES_MLNO, | ||
798 | #[doc = "0x13ec - TCD Last Source Address Adjustment"] | ||
799 | pub tcd31_slast: TCD31_SLAST, | ||
800 | #[doc = "0x13f0 - TCD Destination Address"] | ||
801 | pub tcd31_daddr: TCD31_DADDR, | ||
802 | #[doc = "0x13f4 - TCD Signed Destination Address Offset"] | ||
803 | pub tcd31_doff: TCD31_DOFF, | ||
804 | #[doc = "0x13f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
805 | pub tcd31_citer_elinkno: TCD31_CITER_ELINKNO, | ||
806 | #[doc = "0x13f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
807 | pub tcd31_dlastsga: TCD31_DLASTSGA, | ||
808 | #[doc = "0x13fc - TCD Control and Status"] | ||
809 | pub tcd31_csr: TCD31_CSR, | ||
810 | #[doc = "0x13fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
811 | pub tcd31_biter_elinkno: TCD31_BITER_ELINKNO, | ||
812 | } | ||
813 | #[doc = "Control Register"] | ||
814 | pub struct CR { | ||
815 | register: VolatileCell<u32>, | ||
816 | } | ||
817 | #[doc = "Control Register"] | ||
818 | pub mod cr; | ||
819 | #[doc = "Error Status Register"] | ||
820 | pub struct ES { | ||
821 | register: VolatileCell<u32>, | ||
822 | } | ||
823 | #[doc = "Error Status Register"] | ||
824 | pub mod es; | ||
825 | #[doc = "Enable Request Register"] | ||
826 | pub struct ERQ { | ||
827 | register: VolatileCell<u32>, | ||
828 | } | ||
829 | #[doc = "Enable Request Register"] | ||
830 | pub mod erq; | ||
831 | #[doc = "Enable Error Interrupt Register"] | ||
832 | pub struct EEI { | ||
833 | register: VolatileCell<u32>, | ||
834 | } | ||
835 | #[doc = "Enable Error Interrupt Register"] | ||
836 | pub mod eei; | ||
837 | #[doc = "Clear Enable Error Interrupt Register"] | ||
838 | pub struct CEEI { | ||
839 | register: VolatileCell<u8>, | ||
840 | } | ||
841 | #[doc = "Clear Enable Error Interrupt Register"] | ||
842 | pub mod ceei; | ||
843 | #[doc = "Set Enable Error Interrupt Register"] | ||
844 | pub struct SEEI { | ||
845 | register: VolatileCell<u8>, | ||
846 | } | ||
847 | #[doc = "Set Enable Error Interrupt Register"] | ||
848 | pub mod seei; | ||
849 | #[doc = "Clear Enable Request Register"] | ||
850 | pub struct CERQ { | ||
851 | register: VolatileCell<u8>, | ||
852 | } | ||
853 | #[doc = "Clear Enable Request Register"] | ||
854 | pub mod cerq; | ||
855 | #[doc = "Set Enable Request Register"] | ||
856 | pub struct SERQ { | ||
857 | register: VolatileCell<u8>, | ||
858 | } | ||
859 | #[doc = "Set Enable Request Register"] | ||
860 | pub mod serq; | ||
861 | #[doc = "Clear DONE Status Bit Register"] | ||
862 | pub struct CDNE { | ||
863 | register: VolatileCell<u8>, | ||
864 | } | ||
865 | #[doc = "Clear DONE Status Bit Register"] | ||
866 | pub mod cdne; | ||
867 | #[doc = "Set START Bit Register"] | ||
868 | pub struct SSRT { | ||
869 | register: VolatileCell<u8>, | ||
870 | } | ||
871 | #[doc = "Set START Bit Register"] | ||
872 | pub mod ssrt; | ||
873 | #[doc = "Clear Error Register"] | ||
874 | pub struct CERR { | ||
875 | register: VolatileCell<u8>, | ||
876 | } | ||
877 | #[doc = "Clear Error Register"] | ||
878 | pub mod cerr; | ||
879 | #[doc = "Clear Interrupt Request Register"] | ||
880 | pub struct CINT { | ||
881 | register: VolatileCell<u8>, | ||
882 | } | ||
883 | #[doc = "Clear Interrupt Request Register"] | ||
884 | pub mod cint; | ||
885 | #[doc = "Interrupt Request Register"] | ||
886 | pub struct INT { | ||
887 | register: VolatileCell<u32>, | ||
888 | } | ||
889 | #[doc = "Interrupt Request Register"] | ||
890 | pub mod int; | ||
891 | #[doc = "Error Register"] | ||
892 | pub struct ERR { | ||
893 | register: VolatileCell<u32>, | ||
894 | } | ||
895 | #[doc = "Error Register"] | ||
896 | pub mod err; | ||
897 | #[doc = "Hardware Request Status Register"] | ||
898 | pub struct HRS { | ||
899 | register: VolatileCell<u32>, | ||
900 | } | ||
901 | #[doc = "Hardware Request Status Register"] | ||
902 | pub mod hrs; | ||
903 | #[doc = "Enable Asynchronous Request in Stop Register"] | ||
904 | pub struct EARS { | ||
905 | register: VolatileCell<u32>, | ||
906 | } | ||
907 | #[doc = "Enable Asynchronous Request in Stop Register"] | ||
908 | pub mod ears; | ||
909 | #[doc = "Channel n Priority Register"] | ||
910 | pub struct DCHPRI3 { | ||
911 | register: VolatileCell<u8>, | ||
912 | } | ||
913 | #[doc = "Channel n Priority Register"] | ||
914 | pub mod dchpri3; | ||
915 | #[doc = "Channel n Priority Register"] | ||
916 | pub struct DCHPRI2 { | ||
917 | register: VolatileCell<u8>, | ||
918 | } | ||
919 | #[doc = "Channel n Priority Register"] | ||
920 | pub mod dchpri2; | ||
921 | #[doc = "Channel n Priority Register"] | ||
922 | pub struct DCHPRI1 { | ||
923 | register: VolatileCell<u8>, | ||
924 | } | ||
925 | #[doc = "Channel n Priority Register"] | ||
926 | pub mod dchpri1; | ||
927 | #[doc = "Channel n Priority Register"] | ||
928 | pub struct DCHPRI0 { | ||
929 | register: VolatileCell<u8>, | ||
930 | } | ||
931 | #[doc = "Channel n Priority Register"] | ||
932 | pub mod dchpri0; | ||
933 | #[doc = "Channel n Priority Register"] | ||
934 | pub struct DCHPRI7 { | ||
935 | register: VolatileCell<u8>, | ||
936 | } | ||
937 | #[doc = "Channel n Priority Register"] | ||
938 | pub mod dchpri7; | ||
939 | #[doc = "Channel n Priority Register"] | ||
940 | pub struct DCHPRI6 { | ||
941 | register: VolatileCell<u8>, | ||
942 | } | ||
943 | #[doc = "Channel n Priority Register"] | ||
944 | pub mod dchpri6; | ||
945 | #[doc = "Channel n Priority Register"] | ||
946 | pub struct DCHPRI5 { | ||
947 | register: VolatileCell<u8>, | ||
948 | } | ||
949 | #[doc = "Channel n Priority Register"] | ||
950 | pub mod dchpri5; | ||
951 | #[doc = "Channel n Priority Register"] | ||
952 | pub struct DCHPRI4 { | ||
953 | register: VolatileCell<u8>, | ||
954 | } | ||
955 | #[doc = "Channel n Priority Register"] | ||
956 | pub mod dchpri4; | ||
957 | #[doc = "Channel n Priority Register"] | ||
958 | pub struct DCHPRI11 { | ||
959 | register: VolatileCell<u8>, | ||
960 | } | ||
961 | #[doc = "Channel n Priority Register"] | ||
962 | pub mod dchpri11; | ||
963 | #[doc = "Channel n Priority Register"] | ||
964 | pub struct DCHPRI10 { | ||
965 | register: VolatileCell<u8>, | ||
966 | } | ||
967 | #[doc = "Channel n Priority Register"] | ||
968 | pub mod dchpri10; | ||
969 | #[doc = "Channel n Priority Register"] | ||
970 | pub struct DCHPRI9 { | ||
971 | register: VolatileCell<u8>, | ||
972 | } | ||
973 | #[doc = "Channel n Priority Register"] | ||
974 | pub mod dchpri9; | ||
975 | #[doc = "Channel n Priority Register"] | ||
976 | pub struct DCHPRI8 { | ||
977 | register: VolatileCell<u8>, | ||
978 | } | ||
979 | #[doc = "Channel n Priority Register"] | ||
980 | pub mod dchpri8; | ||
981 | #[doc = "Channel n Priority Register"] | ||
982 | pub struct DCHPRI15 { | ||
983 | register: VolatileCell<u8>, | ||
984 | } | ||
985 | #[doc = "Channel n Priority Register"] | ||
986 | pub mod dchpri15; | ||
987 | #[doc = "Channel n Priority Register"] | ||
988 | pub struct DCHPRI14 { | ||
989 | register: VolatileCell<u8>, | ||
990 | } | ||
991 | #[doc = "Channel n Priority Register"] | ||
992 | pub mod dchpri14; | ||
993 | #[doc = "Channel n Priority Register"] | ||
994 | pub struct DCHPRI13 { | ||
995 | register: VolatileCell<u8>, | ||
996 | } | ||
997 | #[doc = "Channel n Priority Register"] | ||
998 | pub mod dchpri13; | ||
999 | #[doc = "Channel n Priority Register"] | ||
1000 | pub struct DCHPRI12 { | ||
1001 | register: VolatileCell<u8>, | ||
1002 | } | ||
1003 | #[doc = "Channel n Priority Register"] | ||
1004 | pub mod dchpri12; | ||
1005 | #[doc = "Channel n Priority Register"] | ||
1006 | pub struct DCHPRI19 { | ||
1007 | register: VolatileCell<u8>, | ||
1008 | } | ||
1009 | #[doc = "Channel n Priority Register"] | ||
1010 | pub mod dchpri19; | ||
1011 | #[doc = "Channel n Priority Register"] | ||
1012 | pub struct DCHPRI18 { | ||
1013 | register: VolatileCell<u8>, | ||
1014 | } | ||
1015 | #[doc = "Channel n Priority Register"] | ||
1016 | pub mod dchpri18; | ||
1017 | #[doc = "Channel n Priority Register"] | ||
1018 | pub struct DCHPRI17 { | ||
1019 | register: VolatileCell<u8>, | ||
1020 | } | ||
1021 | #[doc = "Channel n Priority Register"] | ||
1022 | pub mod dchpri17; | ||
1023 | #[doc = "Channel n Priority Register"] | ||
1024 | pub struct DCHPRI16 { | ||
1025 | register: VolatileCell<u8>, | ||
1026 | } | ||
1027 | #[doc = "Channel n Priority Register"] | ||
1028 | pub mod dchpri16; | ||
1029 | #[doc = "Channel n Priority Register"] | ||
1030 | pub struct DCHPRI23 { | ||
1031 | register: VolatileCell<u8>, | ||
1032 | } | ||
1033 | #[doc = "Channel n Priority Register"] | ||
1034 | pub mod dchpri23; | ||
1035 | #[doc = "Channel n Priority Register"] | ||
1036 | pub struct DCHPRI22 { | ||
1037 | register: VolatileCell<u8>, | ||
1038 | } | ||
1039 | #[doc = "Channel n Priority Register"] | ||
1040 | pub mod dchpri22; | ||
1041 | #[doc = "Channel n Priority Register"] | ||
1042 | pub struct DCHPRI21 { | ||
1043 | register: VolatileCell<u8>, | ||
1044 | } | ||
1045 | #[doc = "Channel n Priority Register"] | ||
1046 | pub mod dchpri21; | ||
1047 | #[doc = "Channel n Priority Register"] | ||
1048 | pub struct DCHPRI20 { | ||
1049 | register: VolatileCell<u8>, | ||
1050 | } | ||
1051 | #[doc = "Channel n Priority Register"] | ||
1052 | pub mod dchpri20; | ||
1053 | #[doc = "Channel n Priority Register"] | ||
1054 | pub struct DCHPRI27 { | ||
1055 | register: VolatileCell<u8>, | ||
1056 | } | ||
1057 | #[doc = "Channel n Priority Register"] | ||
1058 | pub mod dchpri27; | ||
1059 | #[doc = "Channel n Priority Register"] | ||
1060 | pub struct DCHPRI26 { | ||
1061 | register: VolatileCell<u8>, | ||
1062 | } | ||
1063 | #[doc = "Channel n Priority Register"] | ||
1064 | pub mod dchpri26; | ||
1065 | #[doc = "Channel n Priority Register"] | ||
1066 | pub struct DCHPRI25 { | ||
1067 | register: VolatileCell<u8>, | ||
1068 | } | ||
1069 | #[doc = "Channel n Priority Register"] | ||
1070 | pub mod dchpri25; | ||
1071 | #[doc = "Channel n Priority Register"] | ||
1072 | pub struct DCHPRI24 { | ||
1073 | register: VolatileCell<u8>, | ||
1074 | } | ||
1075 | #[doc = "Channel n Priority Register"] | ||
1076 | pub mod dchpri24; | ||
1077 | #[doc = "Channel n Priority Register"] | ||
1078 | pub struct DCHPRI31 { | ||
1079 | register: VolatileCell<u8>, | ||
1080 | } | ||
1081 | #[doc = "Channel n Priority Register"] | ||
1082 | pub mod dchpri31; | ||
1083 | #[doc = "Channel n Priority Register"] | ||
1084 | pub struct DCHPRI30 { | ||
1085 | register: VolatileCell<u8>, | ||
1086 | } | ||
1087 | #[doc = "Channel n Priority Register"] | ||
1088 | pub mod dchpri30; | ||
1089 | #[doc = "Channel n Priority Register"] | ||
1090 | pub struct DCHPRI29 { | ||
1091 | register: VolatileCell<u8>, | ||
1092 | } | ||
1093 | #[doc = "Channel n Priority Register"] | ||
1094 | pub mod dchpri29; | ||
1095 | #[doc = "Channel n Priority Register"] | ||
1096 | pub struct DCHPRI28 { | ||
1097 | register: VolatileCell<u8>, | ||
1098 | } | ||
1099 | #[doc = "Channel n Priority Register"] | ||
1100 | pub mod dchpri28; | ||
1101 | #[doc = "TCD Source Address"] | ||
1102 | pub struct TCD0_SADDR { | ||
1103 | register: VolatileCell<u32>, | ||
1104 | } | ||
1105 | #[doc = "TCD Source Address"] | ||
1106 | pub mod tcd0_saddr; | ||
1107 | #[doc = "TCD Signed Source Address Offset"] | ||
1108 | pub struct TCD0_SOFF { | ||
1109 | register: VolatileCell<u16>, | ||
1110 | } | ||
1111 | #[doc = "TCD Signed Source Address Offset"] | ||
1112 | pub mod tcd0_soff; | ||
1113 | #[doc = "TCD Transfer Attributes"] | ||
1114 | pub struct TCD0_ATTR { | ||
1115 | register: VolatileCell<u16>, | ||
1116 | } | ||
1117 | #[doc = "TCD Transfer Attributes"] | ||
1118 | pub mod tcd0_attr; | ||
1119 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1120 | pub struct TCD0_NBYTES_MLNO { | ||
1121 | register: VolatileCell<u32>, | ||
1122 | } | ||
1123 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1124 | pub mod tcd0_nbytes_mlno; | ||
1125 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1126 | pub struct TCD0_NBYTES_MLOFFNO { | ||
1127 | register: VolatileCell<u32>, | ||
1128 | } | ||
1129 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1130 | pub mod tcd0_nbytes_mloffno; | ||
1131 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1132 | pub struct TCD0_NBYTES_MLOFFYES { | ||
1133 | register: VolatileCell<u32>, | ||
1134 | } | ||
1135 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1136 | pub mod tcd0_nbytes_mloffyes; | ||
1137 | #[doc = "TCD Last Source Address Adjustment"] | ||
1138 | pub struct TCD0_SLAST { | ||
1139 | register: VolatileCell<u32>, | ||
1140 | } | ||
1141 | #[doc = "TCD Last Source Address Adjustment"] | ||
1142 | pub mod tcd0_slast; | ||
1143 | #[doc = "TCD Destination Address"] | ||
1144 | pub struct TCD0_DADDR { | ||
1145 | register: VolatileCell<u32>, | ||
1146 | } | ||
1147 | #[doc = "TCD Destination Address"] | ||
1148 | pub mod tcd0_daddr; | ||
1149 | #[doc = "TCD Signed Destination Address Offset"] | ||
1150 | pub struct TCD0_DOFF { | ||
1151 | register: VolatileCell<u16>, | ||
1152 | } | ||
1153 | #[doc = "TCD Signed Destination Address Offset"] | ||
1154 | pub mod tcd0_doff; | ||
1155 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1156 | pub struct TCD0_CITER_ELINKNO { | ||
1157 | register: VolatileCell<u16>, | ||
1158 | } | ||
1159 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1160 | pub mod tcd0_citer_elinkno; | ||
1161 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1162 | pub struct TCD0_CITER_ELINKYES { | ||
1163 | register: VolatileCell<u16>, | ||
1164 | } | ||
1165 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1166 | pub mod tcd0_citer_elinkyes; | ||
1167 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1168 | pub struct TCD0_DLASTSGA { | ||
1169 | register: VolatileCell<u32>, | ||
1170 | } | ||
1171 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1172 | pub mod tcd0_dlastsga; | ||
1173 | #[doc = "TCD Control and Status"] | ||
1174 | pub struct TCD0_CSR { | ||
1175 | register: VolatileCell<u16>, | ||
1176 | } | ||
1177 | #[doc = "TCD Control and Status"] | ||
1178 | pub mod tcd0_csr; | ||
1179 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1180 | pub struct TCD0_BITER_ELINKNO { | ||
1181 | register: VolatileCell<u16>, | ||
1182 | } | ||
1183 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1184 | pub mod tcd0_biter_elinkno; | ||
1185 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1186 | pub struct TCD0_BITER_ELINKYES { | ||
1187 | register: VolatileCell<u16>, | ||
1188 | } | ||
1189 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1190 | pub mod tcd0_biter_elinkyes; | ||
1191 | #[doc = "TCD Source Address"] | ||
1192 | pub struct TCD1_SADDR { | ||
1193 | register: VolatileCell<u32>, | ||
1194 | } | ||
1195 | #[doc = "TCD Source Address"] | ||
1196 | pub mod tcd1_saddr; | ||
1197 | #[doc = "TCD Signed Source Address Offset"] | ||
1198 | pub struct TCD1_SOFF { | ||
1199 | register: VolatileCell<u16>, | ||
1200 | } | ||
1201 | #[doc = "TCD Signed Source Address Offset"] | ||
1202 | pub mod tcd1_soff; | ||
1203 | #[doc = "TCD Transfer Attributes"] | ||
1204 | pub struct TCD1_ATTR { | ||
1205 | register: VolatileCell<u16>, | ||
1206 | } | ||
1207 | #[doc = "TCD Transfer Attributes"] | ||
1208 | pub mod tcd1_attr; | ||
1209 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1210 | pub struct TCD1_NBYTES_MLNO { | ||
1211 | register: VolatileCell<u32>, | ||
1212 | } | ||
1213 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1214 | pub mod tcd1_nbytes_mlno; | ||
1215 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1216 | pub struct TCD1_NBYTES_MLOFFNO { | ||
1217 | register: VolatileCell<u32>, | ||
1218 | } | ||
1219 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1220 | pub mod tcd1_nbytes_mloffno; | ||
1221 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1222 | pub struct TCD1_NBYTES_MLOFFYES { | ||
1223 | register: VolatileCell<u32>, | ||
1224 | } | ||
1225 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1226 | pub mod tcd1_nbytes_mloffyes; | ||
1227 | #[doc = "TCD Last Source Address Adjustment"] | ||
1228 | pub struct TCD1_SLAST { | ||
1229 | register: VolatileCell<u32>, | ||
1230 | } | ||
1231 | #[doc = "TCD Last Source Address Adjustment"] | ||
1232 | pub mod tcd1_slast; | ||
1233 | #[doc = "TCD Destination Address"] | ||
1234 | pub struct TCD1_DADDR { | ||
1235 | register: VolatileCell<u32>, | ||
1236 | } | ||
1237 | #[doc = "TCD Destination Address"] | ||
1238 | pub mod tcd1_daddr; | ||
1239 | #[doc = "TCD Signed Destination Address Offset"] | ||
1240 | pub struct TCD1_DOFF { | ||
1241 | register: VolatileCell<u16>, | ||
1242 | } | ||
1243 | #[doc = "TCD Signed Destination Address Offset"] | ||
1244 | pub mod tcd1_doff; | ||
1245 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1246 | pub struct TCD1_CITER_ELINKNO { | ||
1247 | register: VolatileCell<u16>, | ||
1248 | } | ||
1249 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1250 | pub mod tcd1_citer_elinkno; | ||
1251 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1252 | pub struct TCD1_CITER_ELINKYES { | ||
1253 | register: VolatileCell<u16>, | ||
1254 | } | ||
1255 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1256 | pub mod tcd1_citer_elinkyes; | ||
1257 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1258 | pub struct TCD1_DLASTSGA { | ||
1259 | register: VolatileCell<u32>, | ||
1260 | } | ||
1261 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1262 | pub mod tcd1_dlastsga; | ||
1263 | #[doc = "TCD Control and Status"] | ||
1264 | pub struct TCD1_CSR { | ||
1265 | register: VolatileCell<u16>, | ||
1266 | } | ||
1267 | #[doc = "TCD Control and Status"] | ||
1268 | pub mod tcd1_csr; | ||
1269 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1270 | pub struct TCD1_BITER_ELINKNO { | ||
1271 | register: VolatileCell<u16>, | ||
1272 | } | ||
1273 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1274 | pub mod tcd1_biter_elinkno; | ||
1275 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1276 | pub struct TCD1_BITER_ELINKYES { | ||
1277 | register: VolatileCell<u16>, | ||
1278 | } | ||
1279 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1280 | pub mod tcd1_biter_elinkyes; | ||
1281 | #[doc = "TCD Source Address"] | ||
1282 | pub struct TCD2_SADDR { | ||
1283 | register: VolatileCell<u32>, | ||
1284 | } | ||
1285 | #[doc = "TCD Source Address"] | ||
1286 | pub mod tcd2_saddr; | ||
1287 | #[doc = "TCD Signed Source Address Offset"] | ||
1288 | pub struct TCD2_SOFF { | ||
1289 | register: VolatileCell<u16>, | ||
1290 | } | ||
1291 | #[doc = "TCD Signed Source Address Offset"] | ||
1292 | pub mod tcd2_soff; | ||
1293 | #[doc = "TCD Transfer Attributes"] | ||
1294 | pub struct TCD2_ATTR { | ||
1295 | register: VolatileCell<u16>, | ||
1296 | } | ||
1297 | #[doc = "TCD Transfer Attributes"] | ||
1298 | pub mod tcd2_attr; | ||
1299 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1300 | pub struct TCD2_NBYTES_MLNO { | ||
1301 | register: VolatileCell<u32>, | ||
1302 | } | ||
1303 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1304 | pub mod tcd2_nbytes_mlno; | ||
1305 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1306 | pub struct TCD2_NBYTES_MLOFFNO { | ||
1307 | register: VolatileCell<u32>, | ||
1308 | } | ||
1309 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1310 | pub mod tcd2_nbytes_mloffno; | ||
1311 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1312 | pub struct TCD2_NBYTES_MLOFFYES { | ||
1313 | register: VolatileCell<u32>, | ||
1314 | } | ||
1315 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1316 | pub mod tcd2_nbytes_mloffyes; | ||
1317 | #[doc = "TCD Last Source Address Adjustment"] | ||
1318 | pub struct TCD2_SLAST { | ||
1319 | register: VolatileCell<u32>, | ||
1320 | } | ||
1321 | #[doc = "TCD Last Source Address Adjustment"] | ||
1322 | pub mod tcd2_slast; | ||
1323 | #[doc = "TCD Destination Address"] | ||
1324 | pub struct TCD2_DADDR { | ||
1325 | register: VolatileCell<u32>, | ||
1326 | } | ||
1327 | #[doc = "TCD Destination Address"] | ||
1328 | pub mod tcd2_daddr; | ||
1329 | #[doc = "TCD Signed Destination Address Offset"] | ||
1330 | pub struct TCD2_DOFF { | ||
1331 | register: VolatileCell<u16>, | ||
1332 | } | ||
1333 | #[doc = "TCD Signed Destination Address Offset"] | ||
1334 | pub mod tcd2_doff; | ||
1335 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1336 | pub struct TCD2_CITER_ELINKNO { | ||
1337 | register: VolatileCell<u16>, | ||
1338 | } | ||
1339 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1340 | pub mod tcd2_citer_elinkno; | ||
1341 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1342 | pub struct TCD2_CITER_ELINKYES { | ||
1343 | register: VolatileCell<u16>, | ||
1344 | } | ||
1345 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1346 | pub mod tcd2_citer_elinkyes; | ||
1347 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1348 | pub struct TCD2_DLASTSGA { | ||
1349 | register: VolatileCell<u32>, | ||
1350 | } | ||
1351 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1352 | pub mod tcd2_dlastsga; | ||
1353 | #[doc = "TCD Control and Status"] | ||
1354 | pub struct TCD2_CSR { | ||
1355 | register: VolatileCell<u16>, | ||
1356 | } | ||
1357 | #[doc = "TCD Control and Status"] | ||
1358 | pub mod tcd2_csr; | ||
1359 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1360 | pub struct TCD2_BITER_ELINKNO { | ||
1361 | register: VolatileCell<u16>, | ||
1362 | } | ||
1363 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1364 | pub mod tcd2_biter_elinkno; | ||
1365 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1366 | pub struct TCD2_BITER_ELINKYES { | ||
1367 | register: VolatileCell<u16>, | ||
1368 | } | ||
1369 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1370 | pub mod tcd2_biter_elinkyes; | ||
1371 | #[doc = "TCD Source Address"] | ||
1372 | pub struct TCD3_SADDR { | ||
1373 | register: VolatileCell<u32>, | ||
1374 | } | ||
1375 | #[doc = "TCD Source Address"] | ||
1376 | pub mod tcd3_saddr; | ||
1377 | #[doc = "TCD Signed Source Address Offset"] | ||
1378 | pub struct TCD3_SOFF { | ||
1379 | register: VolatileCell<u16>, | ||
1380 | } | ||
1381 | #[doc = "TCD Signed Source Address Offset"] | ||
1382 | pub mod tcd3_soff; | ||
1383 | #[doc = "TCD Transfer Attributes"] | ||
1384 | pub struct TCD3_ATTR { | ||
1385 | register: VolatileCell<u16>, | ||
1386 | } | ||
1387 | #[doc = "TCD Transfer Attributes"] | ||
1388 | pub mod tcd3_attr; | ||
1389 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1390 | pub struct TCD3_NBYTES_MLNO { | ||
1391 | register: VolatileCell<u32>, | ||
1392 | } | ||
1393 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1394 | pub mod tcd3_nbytes_mlno; | ||
1395 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1396 | pub struct TCD3_NBYTES_MLOFFNO { | ||
1397 | register: VolatileCell<u32>, | ||
1398 | } | ||
1399 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1400 | pub mod tcd3_nbytes_mloffno; | ||
1401 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1402 | pub struct TCD3_NBYTES_MLOFFYES { | ||
1403 | register: VolatileCell<u32>, | ||
1404 | } | ||
1405 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1406 | pub mod tcd3_nbytes_mloffyes; | ||
1407 | #[doc = "TCD Last Source Address Adjustment"] | ||
1408 | pub struct TCD3_SLAST { | ||
1409 | register: VolatileCell<u32>, | ||
1410 | } | ||
1411 | #[doc = "TCD Last Source Address Adjustment"] | ||
1412 | pub mod tcd3_slast; | ||
1413 | #[doc = "TCD Destination Address"] | ||
1414 | pub struct TCD3_DADDR { | ||
1415 | register: VolatileCell<u32>, | ||
1416 | } | ||
1417 | #[doc = "TCD Destination Address"] | ||
1418 | pub mod tcd3_daddr; | ||
1419 | #[doc = "TCD Signed Destination Address Offset"] | ||
1420 | pub struct TCD3_DOFF { | ||
1421 | register: VolatileCell<u16>, | ||
1422 | } | ||
1423 | #[doc = "TCD Signed Destination Address Offset"] | ||
1424 | pub mod tcd3_doff; | ||
1425 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1426 | pub struct TCD3_CITER_ELINKNO { | ||
1427 | register: VolatileCell<u16>, | ||
1428 | } | ||
1429 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1430 | pub mod tcd3_citer_elinkno; | ||
1431 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1432 | pub struct TCD3_CITER_ELINKYES { | ||
1433 | register: VolatileCell<u16>, | ||
1434 | } | ||
1435 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1436 | pub mod tcd3_citer_elinkyes; | ||
1437 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1438 | pub struct TCD3_DLASTSGA { | ||
1439 | register: VolatileCell<u32>, | ||
1440 | } | ||
1441 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1442 | pub mod tcd3_dlastsga; | ||
1443 | #[doc = "TCD Control and Status"] | ||
1444 | pub struct TCD3_CSR { | ||
1445 | register: VolatileCell<u16>, | ||
1446 | } | ||
1447 | #[doc = "TCD Control and Status"] | ||
1448 | pub mod tcd3_csr; | ||
1449 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1450 | pub struct TCD3_BITER_ELINKNO { | ||
1451 | register: VolatileCell<u16>, | ||
1452 | } | ||
1453 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1454 | pub mod tcd3_biter_elinkno; | ||
1455 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1456 | pub struct TCD3_BITER_ELINKYES { | ||
1457 | register: VolatileCell<u16>, | ||
1458 | } | ||
1459 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1460 | pub mod tcd3_biter_elinkyes; | ||
1461 | #[doc = "TCD Source Address"] | ||
1462 | pub struct TCD4_SADDR { | ||
1463 | register: VolatileCell<u32>, | ||
1464 | } | ||
1465 | #[doc = "TCD Source Address"] | ||
1466 | pub mod tcd4_saddr; | ||
1467 | #[doc = "TCD Signed Source Address Offset"] | ||
1468 | pub struct TCD4_SOFF { | ||
1469 | register: VolatileCell<u16>, | ||
1470 | } | ||
1471 | #[doc = "TCD Signed Source Address Offset"] | ||
1472 | pub mod tcd4_soff; | ||
1473 | #[doc = "TCD Transfer Attributes"] | ||
1474 | pub struct TCD4_ATTR { | ||
1475 | register: VolatileCell<u16>, | ||
1476 | } | ||
1477 | #[doc = "TCD Transfer Attributes"] | ||
1478 | pub mod tcd4_attr; | ||
1479 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1480 | pub struct TCD4_NBYTES_MLNO { | ||
1481 | register: VolatileCell<u32>, | ||
1482 | } | ||
1483 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1484 | pub mod tcd4_nbytes_mlno; | ||
1485 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1486 | pub struct TCD4_NBYTES_MLOFFNO { | ||
1487 | register: VolatileCell<u32>, | ||
1488 | } | ||
1489 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1490 | pub mod tcd4_nbytes_mloffno; | ||
1491 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1492 | pub struct TCD4_NBYTES_MLOFFYES { | ||
1493 | register: VolatileCell<u32>, | ||
1494 | } | ||
1495 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1496 | pub mod tcd4_nbytes_mloffyes; | ||
1497 | #[doc = "TCD Last Source Address Adjustment"] | ||
1498 | pub struct TCD4_SLAST { | ||
1499 | register: VolatileCell<u32>, | ||
1500 | } | ||
1501 | #[doc = "TCD Last Source Address Adjustment"] | ||
1502 | pub mod tcd4_slast; | ||
1503 | #[doc = "TCD Destination Address"] | ||
1504 | pub struct TCD4_DADDR { | ||
1505 | register: VolatileCell<u32>, | ||
1506 | } | ||
1507 | #[doc = "TCD Destination Address"] | ||
1508 | pub mod tcd4_daddr; | ||
1509 | #[doc = "TCD Signed Destination Address Offset"] | ||
1510 | pub struct TCD4_DOFF { | ||
1511 | register: VolatileCell<u16>, | ||
1512 | } | ||
1513 | #[doc = "TCD Signed Destination Address Offset"] | ||
1514 | pub mod tcd4_doff; | ||
1515 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1516 | pub struct TCD4_CITER_ELINKNO { | ||
1517 | register: VolatileCell<u16>, | ||
1518 | } | ||
1519 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1520 | pub mod tcd4_citer_elinkno; | ||
1521 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1522 | pub struct TCD4_CITER_ELINKYES { | ||
1523 | register: VolatileCell<u16>, | ||
1524 | } | ||
1525 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1526 | pub mod tcd4_citer_elinkyes; | ||
1527 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1528 | pub struct TCD4_DLASTSGA { | ||
1529 | register: VolatileCell<u32>, | ||
1530 | } | ||
1531 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1532 | pub mod tcd4_dlastsga; | ||
1533 | #[doc = "TCD Control and Status"] | ||
1534 | pub struct TCD4_CSR { | ||
1535 | register: VolatileCell<u16>, | ||
1536 | } | ||
1537 | #[doc = "TCD Control and Status"] | ||
1538 | pub mod tcd4_csr; | ||
1539 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1540 | pub struct TCD4_BITER_ELINKNO { | ||
1541 | register: VolatileCell<u16>, | ||
1542 | } | ||
1543 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1544 | pub mod tcd4_biter_elinkno; | ||
1545 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1546 | pub struct TCD4_BITER_ELINKYES { | ||
1547 | register: VolatileCell<u16>, | ||
1548 | } | ||
1549 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1550 | pub mod tcd4_biter_elinkyes; | ||
1551 | #[doc = "TCD Source Address"] | ||
1552 | pub struct TCD5_SADDR { | ||
1553 | register: VolatileCell<u32>, | ||
1554 | } | ||
1555 | #[doc = "TCD Source Address"] | ||
1556 | pub mod tcd5_saddr; | ||
1557 | #[doc = "TCD Signed Source Address Offset"] | ||
1558 | pub struct TCD5_SOFF { | ||
1559 | register: VolatileCell<u16>, | ||
1560 | } | ||
1561 | #[doc = "TCD Signed Source Address Offset"] | ||
1562 | pub mod tcd5_soff; | ||
1563 | #[doc = "TCD Transfer Attributes"] | ||
1564 | pub struct TCD5_ATTR { | ||
1565 | register: VolatileCell<u16>, | ||
1566 | } | ||
1567 | #[doc = "TCD Transfer Attributes"] | ||
1568 | pub mod tcd5_attr; | ||
1569 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1570 | pub struct TCD5_NBYTES_MLNO { | ||
1571 | register: VolatileCell<u32>, | ||
1572 | } | ||
1573 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1574 | pub mod tcd5_nbytes_mlno; | ||
1575 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1576 | pub struct TCD5_NBYTES_MLOFFNO { | ||
1577 | register: VolatileCell<u32>, | ||
1578 | } | ||
1579 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1580 | pub mod tcd5_nbytes_mloffno; | ||
1581 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1582 | pub struct TCD5_NBYTES_MLOFFYES { | ||
1583 | register: VolatileCell<u32>, | ||
1584 | } | ||
1585 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1586 | pub mod tcd5_nbytes_mloffyes; | ||
1587 | #[doc = "TCD Last Source Address Adjustment"] | ||
1588 | pub struct TCD5_SLAST { | ||
1589 | register: VolatileCell<u32>, | ||
1590 | } | ||
1591 | #[doc = "TCD Last Source Address Adjustment"] | ||
1592 | pub mod tcd5_slast; | ||
1593 | #[doc = "TCD Destination Address"] | ||
1594 | pub struct TCD5_DADDR { | ||
1595 | register: VolatileCell<u32>, | ||
1596 | } | ||
1597 | #[doc = "TCD Destination Address"] | ||
1598 | pub mod tcd5_daddr; | ||
1599 | #[doc = "TCD Signed Destination Address Offset"] | ||
1600 | pub struct TCD5_DOFF { | ||
1601 | register: VolatileCell<u16>, | ||
1602 | } | ||
1603 | #[doc = "TCD Signed Destination Address Offset"] | ||
1604 | pub mod tcd5_doff; | ||
1605 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1606 | pub struct TCD5_CITER_ELINKNO { | ||
1607 | register: VolatileCell<u16>, | ||
1608 | } | ||
1609 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1610 | pub mod tcd5_citer_elinkno; | ||
1611 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1612 | pub struct TCD5_CITER_ELINKYES { | ||
1613 | register: VolatileCell<u16>, | ||
1614 | } | ||
1615 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1616 | pub mod tcd5_citer_elinkyes; | ||
1617 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1618 | pub struct TCD5_DLASTSGA { | ||
1619 | register: VolatileCell<u32>, | ||
1620 | } | ||
1621 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1622 | pub mod tcd5_dlastsga; | ||
1623 | #[doc = "TCD Control and Status"] | ||
1624 | pub struct TCD5_CSR { | ||
1625 | register: VolatileCell<u16>, | ||
1626 | } | ||
1627 | #[doc = "TCD Control and Status"] | ||
1628 | pub mod tcd5_csr; | ||
1629 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1630 | pub struct TCD5_BITER_ELINKNO { | ||
1631 | register: VolatileCell<u16>, | ||
1632 | } | ||
1633 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1634 | pub mod tcd5_biter_elinkno; | ||
1635 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1636 | pub struct TCD5_BITER_ELINKYES { | ||
1637 | register: VolatileCell<u16>, | ||
1638 | } | ||
1639 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1640 | pub mod tcd5_biter_elinkyes; | ||
1641 | #[doc = "TCD Source Address"] | ||
1642 | pub struct TCD6_SADDR { | ||
1643 | register: VolatileCell<u32>, | ||
1644 | } | ||
1645 | #[doc = "TCD Source Address"] | ||
1646 | pub mod tcd6_saddr; | ||
1647 | #[doc = "TCD Signed Source Address Offset"] | ||
1648 | pub struct TCD6_SOFF { | ||
1649 | register: VolatileCell<u16>, | ||
1650 | } | ||
1651 | #[doc = "TCD Signed Source Address Offset"] | ||
1652 | pub mod tcd6_soff; | ||
1653 | #[doc = "TCD Transfer Attributes"] | ||
1654 | pub struct TCD6_ATTR { | ||
1655 | register: VolatileCell<u16>, | ||
1656 | } | ||
1657 | #[doc = "TCD Transfer Attributes"] | ||
1658 | pub mod tcd6_attr; | ||
1659 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1660 | pub struct TCD6_NBYTES_MLNO { | ||
1661 | register: VolatileCell<u32>, | ||
1662 | } | ||
1663 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1664 | pub mod tcd6_nbytes_mlno; | ||
1665 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1666 | pub struct TCD6_NBYTES_MLOFFNO { | ||
1667 | register: VolatileCell<u32>, | ||
1668 | } | ||
1669 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1670 | pub mod tcd6_nbytes_mloffno; | ||
1671 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1672 | pub struct TCD6_NBYTES_MLOFFYES { | ||
1673 | register: VolatileCell<u32>, | ||
1674 | } | ||
1675 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1676 | pub mod tcd6_nbytes_mloffyes; | ||
1677 | #[doc = "TCD Last Source Address Adjustment"] | ||
1678 | pub struct TCD6_SLAST { | ||
1679 | register: VolatileCell<u32>, | ||
1680 | } | ||
1681 | #[doc = "TCD Last Source Address Adjustment"] | ||
1682 | pub mod tcd6_slast; | ||
1683 | #[doc = "TCD Destination Address"] | ||
1684 | pub struct TCD6_DADDR { | ||
1685 | register: VolatileCell<u32>, | ||
1686 | } | ||
1687 | #[doc = "TCD Destination Address"] | ||
1688 | pub mod tcd6_daddr; | ||
1689 | #[doc = "TCD Signed Destination Address Offset"] | ||
1690 | pub struct TCD6_DOFF { | ||
1691 | register: VolatileCell<u16>, | ||
1692 | } | ||
1693 | #[doc = "TCD Signed Destination Address Offset"] | ||
1694 | pub mod tcd6_doff; | ||
1695 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1696 | pub struct TCD6_CITER_ELINKNO { | ||
1697 | register: VolatileCell<u16>, | ||
1698 | } | ||
1699 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1700 | pub mod tcd6_citer_elinkno; | ||
1701 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1702 | pub struct TCD6_CITER_ELINKYES { | ||
1703 | register: VolatileCell<u16>, | ||
1704 | } | ||
1705 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1706 | pub mod tcd6_citer_elinkyes; | ||
1707 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1708 | pub struct TCD6_DLASTSGA { | ||
1709 | register: VolatileCell<u32>, | ||
1710 | } | ||
1711 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1712 | pub mod tcd6_dlastsga; | ||
1713 | #[doc = "TCD Control and Status"] | ||
1714 | pub struct TCD6_CSR { | ||
1715 | register: VolatileCell<u16>, | ||
1716 | } | ||
1717 | #[doc = "TCD Control and Status"] | ||
1718 | pub mod tcd6_csr; | ||
1719 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1720 | pub struct TCD6_BITER_ELINKNO { | ||
1721 | register: VolatileCell<u16>, | ||
1722 | } | ||
1723 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1724 | pub mod tcd6_biter_elinkno; | ||
1725 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1726 | pub struct TCD6_BITER_ELINKYES { | ||
1727 | register: VolatileCell<u16>, | ||
1728 | } | ||
1729 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1730 | pub mod tcd6_biter_elinkyes; | ||
1731 | #[doc = "TCD Source Address"] | ||
1732 | pub struct TCD7_SADDR { | ||
1733 | register: VolatileCell<u32>, | ||
1734 | } | ||
1735 | #[doc = "TCD Source Address"] | ||
1736 | pub mod tcd7_saddr; | ||
1737 | #[doc = "TCD Signed Source Address Offset"] | ||
1738 | pub struct TCD7_SOFF { | ||
1739 | register: VolatileCell<u16>, | ||
1740 | } | ||
1741 | #[doc = "TCD Signed Source Address Offset"] | ||
1742 | pub mod tcd7_soff; | ||
1743 | #[doc = "TCD Transfer Attributes"] | ||
1744 | pub struct TCD7_ATTR { | ||
1745 | register: VolatileCell<u16>, | ||
1746 | } | ||
1747 | #[doc = "TCD Transfer Attributes"] | ||
1748 | pub mod tcd7_attr; | ||
1749 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1750 | pub struct TCD7_NBYTES_MLNO { | ||
1751 | register: VolatileCell<u32>, | ||
1752 | } | ||
1753 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1754 | pub mod tcd7_nbytes_mlno; | ||
1755 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1756 | pub struct TCD7_NBYTES_MLOFFNO { | ||
1757 | register: VolatileCell<u32>, | ||
1758 | } | ||
1759 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1760 | pub mod tcd7_nbytes_mloffno; | ||
1761 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1762 | pub struct TCD7_NBYTES_MLOFFYES { | ||
1763 | register: VolatileCell<u32>, | ||
1764 | } | ||
1765 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1766 | pub mod tcd7_nbytes_mloffyes; | ||
1767 | #[doc = "TCD Last Source Address Adjustment"] | ||
1768 | pub struct TCD7_SLAST { | ||
1769 | register: VolatileCell<u32>, | ||
1770 | } | ||
1771 | #[doc = "TCD Last Source Address Adjustment"] | ||
1772 | pub mod tcd7_slast; | ||
1773 | #[doc = "TCD Destination Address"] | ||
1774 | pub struct TCD7_DADDR { | ||
1775 | register: VolatileCell<u32>, | ||
1776 | } | ||
1777 | #[doc = "TCD Destination Address"] | ||
1778 | pub mod tcd7_daddr; | ||
1779 | #[doc = "TCD Signed Destination Address Offset"] | ||
1780 | pub struct TCD7_DOFF { | ||
1781 | register: VolatileCell<u16>, | ||
1782 | } | ||
1783 | #[doc = "TCD Signed Destination Address Offset"] | ||
1784 | pub mod tcd7_doff; | ||
1785 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1786 | pub struct TCD7_CITER_ELINKNO { | ||
1787 | register: VolatileCell<u16>, | ||
1788 | } | ||
1789 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1790 | pub mod tcd7_citer_elinkno; | ||
1791 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1792 | pub struct TCD7_CITER_ELINKYES { | ||
1793 | register: VolatileCell<u16>, | ||
1794 | } | ||
1795 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1796 | pub mod tcd7_citer_elinkyes; | ||
1797 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1798 | pub struct TCD7_DLASTSGA { | ||
1799 | register: VolatileCell<u32>, | ||
1800 | } | ||
1801 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1802 | pub mod tcd7_dlastsga; | ||
1803 | #[doc = "TCD Control and Status"] | ||
1804 | pub struct TCD7_CSR { | ||
1805 | register: VolatileCell<u16>, | ||
1806 | } | ||
1807 | #[doc = "TCD Control and Status"] | ||
1808 | pub mod tcd7_csr; | ||
1809 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1810 | pub struct TCD7_BITER_ELINKNO { | ||
1811 | register: VolatileCell<u16>, | ||
1812 | } | ||
1813 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1814 | pub mod tcd7_biter_elinkno; | ||
1815 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1816 | pub struct TCD7_BITER_ELINKYES { | ||
1817 | register: VolatileCell<u16>, | ||
1818 | } | ||
1819 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1820 | pub mod tcd7_biter_elinkyes; | ||
1821 | #[doc = "TCD Source Address"] | ||
1822 | pub struct TCD8_SADDR { | ||
1823 | register: VolatileCell<u32>, | ||
1824 | } | ||
1825 | #[doc = "TCD Source Address"] | ||
1826 | pub mod tcd8_saddr; | ||
1827 | #[doc = "TCD Signed Source Address Offset"] | ||
1828 | pub struct TCD8_SOFF { | ||
1829 | register: VolatileCell<u16>, | ||
1830 | } | ||
1831 | #[doc = "TCD Signed Source Address Offset"] | ||
1832 | pub mod tcd8_soff; | ||
1833 | #[doc = "TCD Transfer Attributes"] | ||
1834 | pub struct TCD8_ATTR { | ||
1835 | register: VolatileCell<u16>, | ||
1836 | } | ||
1837 | #[doc = "TCD Transfer Attributes"] | ||
1838 | pub mod tcd8_attr; | ||
1839 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1840 | pub struct TCD8_NBYTES_MLNO { | ||
1841 | register: VolatileCell<u32>, | ||
1842 | } | ||
1843 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1844 | pub mod tcd8_nbytes_mlno; | ||
1845 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1846 | pub struct TCD8_NBYTES_MLOFFNO { | ||
1847 | register: VolatileCell<u32>, | ||
1848 | } | ||
1849 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1850 | pub mod tcd8_nbytes_mloffno; | ||
1851 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1852 | pub struct TCD8_NBYTES_MLOFFYES { | ||
1853 | register: VolatileCell<u32>, | ||
1854 | } | ||
1855 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1856 | pub mod tcd8_nbytes_mloffyes; | ||
1857 | #[doc = "TCD Last Source Address Adjustment"] | ||
1858 | pub struct TCD8_SLAST { | ||
1859 | register: VolatileCell<u32>, | ||
1860 | } | ||
1861 | #[doc = "TCD Last Source Address Adjustment"] | ||
1862 | pub mod tcd8_slast; | ||
1863 | #[doc = "TCD Destination Address"] | ||
1864 | pub struct TCD8_DADDR { | ||
1865 | register: VolatileCell<u32>, | ||
1866 | } | ||
1867 | #[doc = "TCD Destination Address"] | ||
1868 | pub mod tcd8_daddr; | ||
1869 | #[doc = "TCD Signed Destination Address Offset"] | ||
1870 | pub struct TCD8_DOFF { | ||
1871 | register: VolatileCell<u16>, | ||
1872 | } | ||
1873 | #[doc = "TCD Signed Destination Address Offset"] | ||
1874 | pub mod tcd8_doff; | ||
1875 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1876 | pub struct TCD8_CITER_ELINKNO { | ||
1877 | register: VolatileCell<u16>, | ||
1878 | } | ||
1879 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1880 | pub mod tcd8_citer_elinkno; | ||
1881 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1882 | pub struct TCD8_CITER_ELINKYES { | ||
1883 | register: VolatileCell<u16>, | ||
1884 | } | ||
1885 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1886 | pub mod tcd8_citer_elinkyes; | ||
1887 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1888 | pub struct TCD8_DLASTSGA { | ||
1889 | register: VolatileCell<u32>, | ||
1890 | } | ||
1891 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1892 | pub mod tcd8_dlastsga; | ||
1893 | #[doc = "TCD Control and Status"] | ||
1894 | pub struct TCD8_CSR { | ||
1895 | register: VolatileCell<u16>, | ||
1896 | } | ||
1897 | #[doc = "TCD Control and Status"] | ||
1898 | pub mod tcd8_csr; | ||
1899 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1900 | pub struct TCD8_BITER_ELINKNO { | ||
1901 | register: VolatileCell<u16>, | ||
1902 | } | ||
1903 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1904 | pub mod tcd8_biter_elinkno; | ||
1905 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1906 | pub struct TCD8_BITER_ELINKYES { | ||
1907 | register: VolatileCell<u16>, | ||
1908 | } | ||
1909 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1910 | pub mod tcd8_biter_elinkyes; | ||
1911 | #[doc = "TCD Source Address"] | ||
1912 | pub struct TCD9_SADDR { | ||
1913 | register: VolatileCell<u32>, | ||
1914 | } | ||
1915 | #[doc = "TCD Source Address"] | ||
1916 | pub mod tcd9_saddr; | ||
1917 | #[doc = "TCD Signed Source Address Offset"] | ||
1918 | pub struct TCD9_SOFF { | ||
1919 | register: VolatileCell<u16>, | ||
1920 | } | ||
1921 | #[doc = "TCD Signed Source Address Offset"] | ||
1922 | pub mod tcd9_soff; | ||
1923 | #[doc = "TCD Transfer Attributes"] | ||
1924 | pub struct TCD9_ATTR { | ||
1925 | register: VolatileCell<u16>, | ||
1926 | } | ||
1927 | #[doc = "TCD Transfer Attributes"] | ||
1928 | pub mod tcd9_attr; | ||
1929 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1930 | pub struct TCD9_NBYTES_MLNO { | ||
1931 | register: VolatileCell<u32>, | ||
1932 | } | ||
1933 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1934 | pub mod tcd9_nbytes_mlno; | ||
1935 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1936 | pub struct TCD9_NBYTES_MLOFFNO { | ||
1937 | register: VolatileCell<u32>, | ||
1938 | } | ||
1939 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1940 | pub mod tcd9_nbytes_mloffno; | ||
1941 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1942 | pub struct TCD9_NBYTES_MLOFFYES { | ||
1943 | register: VolatileCell<u32>, | ||
1944 | } | ||
1945 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1946 | pub mod tcd9_nbytes_mloffyes; | ||
1947 | #[doc = "TCD Last Source Address Adjustment"] | ||
1948 | pub struct TCD9_SLAST { | ||
1949 | register: VolatileCell<u32>, | ||
1950 | } | ||
1951 | #[doc = "TCD Last Source Address Adjustment"] | ||
1952 | pub mod tcd9_slast; | ||
1953 | #[doc = "TCD Destination Address"] | ||
1954 | pub struct TCD9_DADDR { | ||
1955 | register: VolatileCell<u32>, | ||
1956 | } | ||
1957 | #[doc = "TCD Destination Address"] | ||
1958 | pub mod tcd9_daddr; | ||
1959 | #[doc = "TCD Signed Destination Address Offset"] | ||
1960 | pub struct TCD9_DOFF { | ||
1961 | register: VolatileCell<u16>, | ||
1962 | } | ||
1963 | #[doc = "TCD Signed Destination Address Offset"] | ||
1964 | pub mod tcd9_doff; | ||
1965 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1966 | pub struct TCD9_CITER_ELINKNO { | ||
1967 | register: VolatileCell<u16>, | ||
1968 | } | ||
1969 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1970 | pub mod tcd9_citer_elinkno; | ||
1971 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1972 | pub struct TCD9_CITER_ELINKYES { | ||
1973 | register: VolatileCell<u16>, | ||
1974 | } | ||
1975 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1976 | pub mod tcd9_citer_elinkyes; | ||
1977 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1978 | pub struct TCD9_DLASTSGA { | ||
1979 | register: VolatileCell<u32>, | ||
1980 | } | ||
1981 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1982 | pub mod tcd9_dlastsga; | ||
1983 | #[doc = "TCD Control and Status"] | ||
1984 | pub struct TCD9_CSR { | ||
1985 | register: VolatileCell<u16>, | ||
1986 | } | ||
1987 | #[doc = "TCD Control and Status"] | ||
1988 | pub mod tcd9_csr; | ||
1989 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1990 | pub struct TCD9_BITER_ELINKNO { | ||
1991 | register: VolatileCell<u16>, | ||
1992 | } | ||
1993 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1994 | pub mod tcd9_biter_elinkno; | ||
1995 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1996 | pub struct TCD9_BITER_ELINKYES { | ||
1997 | register: VolatileCell<u16>, | ||
1998 | } | ||
1999 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2000 | pub mod tcd9_biter_elinkyes; | ||
2001 | #[doc = "TCD Source Address"] | ||
2002 | pub struct TCD10_SADDR { | ||
2003 | register: VolatileCell<u32>, | ||
2004 | } | ||
2005 | #[doc = "TCD Source Address"] | ||
2006 | pub mod tcd10_saddr; | ||
2007 | #[doc = "TCD Signed Source Address Offset"] | ||
2008 | pub struct TCD10_SOFF { | ||
2009 | register: VolatileCell<u16>, | ||
2010 | } | ||
2011 | #[doc = "TCD Signed Source Address Offset"] | ||
2012 | pub mod tcd10_soff; | ||
2013 | #[doc = "TCD Transfer Attributes"] | ||
2014 | pub struct TCD10_ATTR { | ||
2015 | register: VolatileCell<u16>, | ||
2016 | } | ||
2017 | #[doc = "TCD Transfer Attributes"] | ||
2018 | pub mod tcd10_attr; | ||
2019 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2020 | pub struct TCD10_NBYTES_MLNO { | ||
2021 | register: VolatileCell<u32>, | ||
2022 | } | ||
2023 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2024 | pub mod tcd10_nbytes_mlno; | ||
2025 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2026 | pub struct TCD10_NBYTES_MLOFFNO { | ||
2027 | register: VolatileCell<u32>, | ||
2028 | } | ||
2029 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2030 | pub mod tcd10_nbytes_mloffno; | ||
2031 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2032 | pub struct TCD10_NBYTES_MLOFFYES { | ||
2033 | register: VolatileCell<u32>, | ||
2034 | } | ||
2035 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2036 | pub mod tcd10_nbytes_mloffyes; | ||
2037 | #[doc = "TCD Last Source Address Adjustment"] | ||
2038 | pub struct TCD10_SLAST { | ||
2039 | register: VolatileCell<u32>, | ||
2040 | } | ||
2041 | #[doc = "TCD Last Source Address Adjustment"] | ||
2042 | pub mod tcd10_slast; | ||
2043 | #[doc = "TCD Destination Address"] | ||
2044 | pub struct TCD10_DADDR { | ||
2045 | register: VolatileCell<u32>, | ||
2046 | } | ||
2047 | #[doc = "TCD Destination Address"] | ||
2048 | pub mod tcd10_daddr; | ||
2049 | #[doc = "TCD Signed Destination Address Offset"] | ||
2050 | pub struct TCD10_DOFF { | ||
2051 | register: VolatileCell<u16>, | ||
2052 | } | ||
2053 | #[doc = "TCD Signed Destination Address Offset"] | ||
2054 | pub mod tcd10_doff; | ||
2055 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2056 | pub struct TCD10_CITER_ELINKNO { | ||
2057 | register: VolatileCell<u16>, | ||
2058 | } | ||
2059 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2060 | pub mod tcd10_citer_elinkno; | ||
2061 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2062 | pub struct TCD10_CITER_ELINKYES { | ||
2063 | register: VolatileCell<u16>, | ||
2064 | } | ||
2065 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2066 | pub mod tcd10_citer_elinkyes; | ||
2067 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2068 | pub struct TCD10_DLASTSGA { | ||
2069 | register: VolatileCell<u32>, | ||
2070 | } | ||
2071 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2072 | pub mod tcd10_dlastsga; | ||
2073 | #[doc = "TCD Control and Status"] | ||
2074 | pub struct TCD10_CSR { | ||
2075 | register: VolatileCell<u16>, | ||
2076 | } | ||
2077 | #[doc = "TCD Control and Status"] | ||
2078 | pub mod tcd10_csr; | ||
2079 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2080 | pub struct TCD10_BITER_ELINKNO { | ||
2081 | register: VolatileCell<u16>, | ||
2082 | } | ||
2083 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2084 | pub mod tcd10_biter_elinkno; | ||
2085 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2086 | pub struct TCD10_BITER_ELINKYES { | ||
2087 | register: VolatileCell<u16>, | ||
2088 | } | ||
2089 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2090 | pub mod tcd10_biter_elinkyes; | ||
2091 | #[doc = "TCD Source Address"] | ||
2092 | pub struct TCD11_SADDR { | ||
2093 | register: VolatileCell<u32>, | ||
2094 | } | ||
2095 | #[doc = "TCD Source Address"] | ||
2096 | pub mod tcd11_saddr; | ||
2097 | #[doc = "TCD Signed Source Address Offset"] | ||
2098 | pub struct TCD11_SOFF { | ||
2099 | register: VolatileCell<u16>, | ||
2100 | } | ||
2101 | #[doc = "TCD Signed Source Address Offset"] | ||
2102 | pub mod tcd11_soff; | ||
2103 | #[doc = "TCD Transfer Attributes"] | ||
2104 | pub struct TCD11_ATTR { | ||
2105 | register: VolatileCell<u16>, | ||
2106 | } | ||
2107 | #[doc = "TCD Transfer Attributes"] | ||
2108 | pub mod tcd11_attr; | ||
2109 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2110 | pub struct TCD11_NBYTES_MLNO { | ||
2111 | register: VolatileCell<u32>, | ||
2112 | } | ||
2113 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2114 | pub mod tcd11_nbytes_mlno; | ||
2115 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2116 | pub struct TCD11_NBYTES_MLOFFNO { | ||
2117 | register: VolatileCell<u32>, | ||
2118 | } | ||
2119 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2120 | pub mod tcd11_nbytes_mloffno; | ||
2121 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2122 | pub struct TCD11_NBYTES_MLOFFYES { | ||
2123 | register: VolatileCell<u32>, | ||
2124 | } | ||
2125 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2126 | pub mod tcd11_nbytes_mloffyes; | ||
2127 | #[doc = "TCD Last Source Address Adjustment"] | ||
2128 | pub struct TCD11_SLAST { | ||
2129 | register: VolatileCell<u32>, | ||
2130 | } | ||
2131 | #[doc = "TCD Last Source Address Adjustment"] | ||
2132 | pub mod tcd11_slast; | ||
2133 | #[doc = "TCD Destination Address"] | ||
2134 | pub struct TCD11_DADDR { | ||
2135 | register: VolatileCell<u32>, | ||
2136 | } | ||
2137 | #[doc = "TCD Destination Address"] | ||
2138 | pub mod tcd11_daddr; | ||
2139 | #[doc = "TCD Signed Destination Address Offset"] | ||
2140 | pub struct TCD11_DOFF { | ||
2141 | register: VolatileCell<u16>, | ||
2142 | } | ||
2143 | #[doc = "TCD Signed Destination Address Offset"] | ||
2144 | pub mod tcd11_doff; | ||
2145 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2146 | pub struct TCD11_CITER_ELINKNO { | ||
2147 | register: VolatileCell<u16>, | ||
2148 | } | ||
2149 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2150 | pub mod tcd11_citer_elinkno; | ||
2151 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2152 | pub struct TCD11_CITER_ELINKYES { | ||
2153 | register: VolatileCell<u16>, | ||
2154 | } | ||
2155 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2156 | pub mod tcd11_citer_elinkyes; | ||
2157 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2158 | pub struct TCD11_DLASTSGA { | ||
2159 | register: VolatileCell<u32>, | ||
2160 | } | ||
2161 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2162 | pub mod tcd11_dlastsga; | ||
2163 | #[doc = "TCD Control and Status"] | ||
2164 | pub struct TCD11_CSR { | ||
2165 | register: VolatileCell<u16>, | ||
2166 | } | ||
2167 | #[doc = "TCD Control and Status"] | ||
2168 | pub mod tcd11_csr; | ||
2169 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2170 | pub struct TCD11_BITER_ELINKNO { | ||
2171 | register: VolatileCell<u16>, | ||
2172 | } | ||
2173 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2174 | pub mod tcd11_biter_elinkno; | ||
2175 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2176 | pub struct TCD11_BITER_ELINKYES { | ||
2177 | register: VolatileCell<u16>, | ||
2178 | } | ||
2179 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2180 | pub mod tcd11_biter_elinkyes; | ||
2181 | #[doc = "TCD Source Address"] | ||
2182 | pub struct TCD12_SADDR { | ||
2183 | register: VolatileCell<u32>, | ||
2184 | } | ||
2185 | #[doc = "TCD Source Address"] | ||
2186 | pub mod tcd12_saddr; | ||
2187 | #[doc = "TCD Signed Source Address Offset"] | ||
2188 | pub struct TCD12_SOFF { | ||
2189 | register: VolatileCell<u16>, | ||
2190 | } | ||
2191 | #[doc = "TCD Signed Source Address Offset"] | ||
2192 | pub mod tcd12_soff; | ||
2193 | #[doc = "TCD Transfer Attributes"] | ||
2194 | pub struct TCD12_ATTR { | ||
2195 | register: VolatileCell<u16>, | ||
2196 | } | ||
2197 | #[doc = "TCD Transfer Attributes"] | ||
2198 | pub mod tcd12_attr; | ||
2199 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2200 | pub struct TCD12_NBYTES_MLNO { | ||
2201 | register: VolatileCell<u32>, | ||
2202 | } | ||
2203 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2204 | pub mod tcd12_nbytes_mlno; | ||
2205 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2206 | pub struct TCD12_NBYTES_MLOFFNO { | ||
2207 | register: VolatileCell<u32>, | ||
2208 | } | ||
2209 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2210 | pub mod tcd12_nbytes_mloffno; | ||
2211 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2212 | pub struct TCD12_NBYTES_MLOFFYES { | ||
2213 | register: VolatileCell<u32>, | ||
2214 | } | ||
2215 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2216 | pub mod tcd12_nbytes_mloffyes; | ||
2217 | #[doc = "TCD Last Source Address Adjustment"] | ||
2218 | pub struct TCD12_SLAST { | ||
2219 | register: VolatileCell<u32>, | ||
2220 | } | ||
2221 | #[doc = "TCD Last Source Address Adjustment"] | ||
2222 | pub mod tcd12_slast; | ||
2223 | #[doc = "TCD Destination Address"] | ||
2224 | pub struct TCD12_DADDR { | ||
2225 | register: VolatileCell<u32>, | ||
2226 | } | ||
2227 | #[doc = "TCD Destination Address"] | ||
2228 | pub mod tcd12_daddr; | ||
2229 | #[doc = "TCD Signed Destination Address Offset"] | ||
2230 | pub struct TCD12_DOFF { | ||
2231 | register: VolatileCell<u16>, | ||
2232 | } | ||
2233 | #[doc = "TCD Signed Destination Address Offset"] | ||
2234 | pub mod tcd12_doff; | ||
2235 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2236 | pub struct TCD12_CITER_ELINKNO { | ||
2237 | register: VolatileCell<u16>, | ||
2238 | } | ||
2239 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2240 | pub mod tcd12_citer_elinkno; | ||
2241 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2242 | pub struct TCD12_CITER_ELINKYES { | ||
2243 | register: VolatileCell<u16>, | ||
2244 | } | ||
2245 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2246 | pub mod tcd12_citer_elinkyes; | ||
2247 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2248 | pub struct TCD12_DLASTSGA { | ||
2249 | register: VolatileCell<u32>, | ||
2250 | } | ||
2251 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2252 | pub mod tcd12_dlastsga; | ||
2253 | #[doc = "TCD Control and Status"] | ||
2254 | pub struct TCD12_CSR { | ||
2255 | register: VolatileCell<u16>, | ||
2256 | } | ||
2257 | #[doc = "TCD Control and Status"] | ||
2258 | pub mod tcd12_csr; | ||
2259 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2260 | pub struct TCD12_BITER_ELINKNO { | ||
2261 | register: VolatileCell<u16>, | ||
2262 | } | ||
2263 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2264 | pub mod tcd12_biter_elinkno; | ||
2265 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2266 | pub struct TCD12_BITER_ELINKYES { | ||
2267 | register: VolatileCell<u16>, | ||
2268 | } | ||
2269 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2270 | pub mod tcd12_biter_elinkyes; | ||
2271 | #[doc = "TCD Source Address"] | ||
2272 | pub struct TCD13_SADDR { | ||
2273 | register: VolatileCell<u32>, | ||
2274 | } | ||
2275 | #[doc = "TCD Source Address"] | ||
2276 | pub mod tcd13_saddr; | ||
2277 | #[doc = "TCD Signed Source Address Offset"] | ||
2278 | pub struct TCD13_SOFF { | ||
2279 | register: VolatileCell<u16>, | ||
2280 | } | ||
2281 | #[doc = "TCD Signed Source Address Offset"] | ||
2282 | pub mod tcd13_soff; | ||
2283 | #[doc = "TCD Transfer Attributes"] | ||
2284 | pub struct TCD13_ATTR { | ||
2285 | register: VolatileCell<u16>, | ||
2286 | } | ||
2287 | #[doc = "TCD Transfer Attributes"] | ||
2288 | pub mod tcd13_attr; | ||
2289 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2290 | pub struct TCD13_NBYTES_MLNO { | ||
2291 | register: VolatileCell<u32>, | ||
2292 | } | ||
2293 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2294 | pub mod tcd13_nbytes_mlno; | ||
2295 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2296 | pub struct TCD13_NBYTES_MLOFFNO { | ||
2297 | register: VolatileCell<u32>, | ||
2298 | } | ||
2299 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2300 | pub mod tcd13_nbytes_mloffno; | ||
2301 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2302 | pub struct TCD13_NBYTES_MLOFFYES { | ||
2303 | register: VolatileCell<u32>, | ||
2304 | } | ||
2305 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2306 | pub mod tcd13_nbytes_mloffyes; | ||
2307 | #[doc = "TCD Last Source Address Adjustment"] | ||
2308 | pub struct TCD13_SLAST { | ||
2309 | register: VolatileCell<u32>, | ||
2310 | } | ||
2311 | #[doc = "TCD Last Source Address Adjustment"] | ||
2312 | pub mod tcd13_slast; | ||
2313 | #[doc = "TCD Destination Address"] | ||
2314 | pub struct TCD13_DADDR { | ||
2315 | register: VolatileCell<u32>, | ||
2316 | } | ||
2317 | #[doc = "TCD Destination Address"] | ||
2318 | pub mod tcd13_daddr; | ||
2319 | #[doc = "TCD Signed Destination Address Offset"] | ||
2320 | pub struct TCD13_DOFF { | ||
2321 | register: VolatileCell<u16>, | ||
2322 | } | ||
2323 | #[doc = "TCD Signed Destination Address Offset"] | ||
2324 | pub mod tcd13_doff; | ||
2325 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2326 | pub struct TCD13_CITER_ELINKNO { | ||
2327 | register: VolatileCell<u16>, | ||
2328 | } | ||
2329 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2330 | pub mod tcd13_citer_elinkno; | ||
2331 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2332 | pub struct TCD13_CITER_ELINKYES { | ||
2333 | register: VolatileCell<u16>, | ||
2334 | } | ||
2335 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2336 | pub mod tcd13_citer_elinkyes; | ||
2337 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2338 | pub struct TCD13_DLASTSGA { | ||
2339 | register: VolatileCell<u32>, | ||
2340 | } | ||
2341 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2342 | pub mod tcd13_dlastsga; | ||
2343 | #[doc = "TCD Control and Status"] | ||
2344 | pub struct TCD13_CSR { | ||
2345 | register: VolatileCell<u16>, | ||
2346 | } | ||
2347 | #[doc = "TCD Control and Status"] | ||
2348 | pub mod tcd13_csr; | ||
2349 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2350 | pub struct TCD13_BITER_ELINKNO { | ||
2351 | register: VolatileCell<u16>, | ||
2352 | } | ||
2353 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2354 | pub mod tcd13_biter_elinkno; | ||
2355 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2356 | pub struct TCD13_BITER_ELINKYES { | ||
2357 | register: VolatileCell<u16>, | ||
2358 | } | ||
2359 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2360 | pub mod tcd13_biter_elinkyes; | ||
2361 | #[doc = "TCD Source Address"] | ||
2362 | pub struct TCD14_SADDR { | ||
2363 | register: VolatileCell<u32>, | ||
2364 | } | ||
2365 | #[doc = "TCD Source Address"] | ||
2366 | pub mod tcd14_saddr; | ||
2367 | #[doc = "TCD Signed Source Address Offset"] | ||
2368 | pub struct TCD14_SOFF { | ||
2369 | register: VolatileCell<u16>, | ||
2370 | } | ||
2371 | #[doc = "TCD Signed Source Address Offset"] | ||
2372 | pub mod tcd14_soff; | ||
2373 | #[doc = "TCD Transfer Attributes"] | ||
2374 | pub struct TCD14_ATTR { | ||
2375 | register: VolatileCell<u16>, | ||
2376 | } | ||
2377 | #[doc = "TCD Transfer Attributes"] | ||
2378 | pub mod tcd14_attr; | ||
2379 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2380 | pub struct TCD14_NBYTES_MLNO { | ||
2381 | register: VolatileCell<u32>, | ||
2382 | } | ||
2383 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2384 | pub mod tcd14_nbytes_mlno; | ||
2385 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2386 | pub struct TCD14_NBYTES_MLOFFNO { | ||
2387 | register: VolatileCell<u32>, | ||
2388 | } | ||
2389 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2390 | pub mod tcd14_nbytes_mloffno; | ||
2391 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2392 | pub struct TCD14_NBYTES_MLOFFYES { | ||
2393 | register: VolatileCell<u32>, | ||
2394 | } | ||
2395 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2396 | pub mod tcd14_nbytes_mloffyes; | ||
2397 | #[doc = "TCD Last Source Address Adjustment"] | ||
2398 | pub struct TCD14_SLAST { | ||
2399 | register: VolatileCell<u32>, | ||
2400 | } | ||
2401 | #[doc = "TCD Last Source Address Adjustment"] | ||
2402 | pub mod tcd14_slast; | ||
2403 | #[doc = "TCD Destination Address"] | ||
2404 | pub struct TCD14_DADDR { | ||
2405 | register: VolatileCell<u32>, | ||
2406 | } | ||
2407 | #[doc = "TCD Destination Address"] | ||
2408 | pub mod tcd14_daddr; | ||
2409 | #[doc = "TCD Signed Destination Address Offset"] | ||
2410 | pub struct TCD14_DOFF { | ||
2411 | register: VolatileCell<u16>, | ||
2412 | } | ||
2413 | #[doc = "TCD Signed Destination Address Offset"] | ||
2414 | pub mod tcd14_doff; | ||
2415 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2416 | pub struct TCD14_CITER_ELINKNO { | ||
2417 | register: VolatileCell<u16>, | ||
2418 | } | ||
2419 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2420 | pub mod tcd14_citer_elinkno; | ||
2421 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2422 | pub struct TCD14_CITER_ELINKYES { | ||
2423 | register: VolatileCell<u16>, | ||
2424 | } | ||
2425 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2426 | pub mod tcd14_citer_elinkyes; | ||
2427 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2428 | pub struct TCD14_DLASTSGA { | ||
2429 | register: VolatileCell<u32>, | ||
2430 | } | ||
2431 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2432 | pub mod tcd14_dlastsga; | ||
2433 | #[doc = "TCD Control and Status"] | ||
2434 | pub struct TCD14_CSR { | ||
2435 | register: VolatileCell<u16>, | ||
2436 | } | ||
2437 | #[doc = "TCD Control and Status"] | ||
2438 | pub mod tcd14_csr; | ||
2439 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2440 | pub struct TCD14_BITER_ELINKNO { | ||
2441 | register: VolatileCell<u16>, | ||
2442 | } | ||
2443 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2444 | pub mod tcd14_biter_elinkno; | ||
2445 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2446 | pub struct TCD14_BITER_ELINKYES { | ||
2447 | register: VolatileCell<u16>, | ||
2448 | } | ||
2449 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2450 | pub mod tcd14_biter_elinkyes; | ||
2451 | #[doc = "TCD Source Address"] | ||
2452 | pub struct TCD15_SADDR { | ||
2453 | register: VolatileCell<u32>, | ||
2454 | } | ||
2455 | #[doc = "TCD Source Address"] | ||
2456 | pub mod tcd15_saddr; | ||
2457 | #[doc = "TCD Signed Source Address Offset"] | ||
2458 | pub struct TCD15_SOFF { | ||
2459 | register: VolatileCell<u16>, | ||
2460 | } | ||
2461 | #[doc = "TCD Signed Source Address Offset"] | ||
2462 | pub mod tcd15_soff; | ||
2463 | #[doc = "TCD Transfer Attributes"] | ||
2464 | pub struct TCD15_ATTR { | ||
2465 | register: VolatileCell<u16>, | ||
2466 | } | ||
2467 | #[doc = "TCD Transfer Attributes"] | ||
2468 | pub mod tcd15_attr; | ||
2469 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2470 | pub struct TCD15_NBYTES_MLNO { | ||
2471 | register: VolatileCell<u32>, | ||
2472 | } | ||
2473 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2474 | pub mod tcd15_nbytes_mlno; | ||
2475 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2476 | pub struct TCD15_NBYTES_MLOFFNO { | ||
2477 | register: VolatileCell<u32>, | ||
2478 | } | ||
2479 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2480 | pub mod tcd15_nbytes_mloffno; | ||
2481 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2482 | pub struct TCD15_NBYTES_MLOFFYES { | ||
2483 | register: VolatileCell<u32>, | ||
2484 | } | ||
2485 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2486 | pub mod tcd15_nbytes_mloffyes; | ||
2487 | #[doc = "TCD Last Source Address Adjustment"] | ||
2488 | pub struct TCD15_SLAST { | ||
2489 | register: VolatileCell<u32>, | ||
2490 | } | ||
2491 | #[doc = "TCD Last Source Address Adjustment"] | ||
2492 | pub mod tcd15_slast; | ||
2493 | #[doc = "TCD Destination Address"] | ||
2494 | pub struct TCD15_DADDR { | ||
2495 | register: VolatileCell<u32>, | ||
2496 | } | ||
2497 | #[doc = "TCD Destination Address"] | ||
2498 | pub mod tcd15_daddr; | ||
2499 | #[doc = "TCD Signed Destination Address Offset"] | ||
2500 | pub struct TCD15_DOFF { | ||
2501 | register: VolatileCell<u16>, | ||
2502 | } | ||
2503 | #[doc = "TCD Signed Destination Address Offset"] | ||
2504 | pub mod tcd15_doff; | ||
2505 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2506 | pub struct TCD15_CITER_ELINKNO { | ||
2507 | register: VolatileCell<u16>, | ||
2508 | } | ||
2509 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2510 | pub mod tcd15_citer_elinkno; | ||
2511 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2512 | pub struct TCD15_CITER_ELINKYES { | ||
2513 | register: VolatileCell<u16>, | ||
2514 | } | ||
2515 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2516 | pub mod tcd15_citer_elinkyes; | ||
2517 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2518 | pub struct TCD15_DLASTSGA { | ||
2519 | register: VolatileCell<u32>, | ||
2520 | } | ||
2521 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2522 | pub mod tcd15_dlastsga; | ||
2523 | #[doc = "TCD Control and Status"] | ||
2524 | pub struct TCD15_CSR { | ||
2525 | register: VolatileCell<u16>, | ||
2526 | } | ||
2527 | #[doc = "TCD Control and Status"] | ||
2528 | pub mod tcd15_csr; | ||
2529 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2530 | pub struct TCD15_BITER_ELINKNO { | ||
2531 | register: VolatileCell<u16>, | ||
2532 | } | ||
2533 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2534 | pub mod tcd15_biter_elinkno; | ||
2535 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2536 | pub struct TCD15_BITER_ELINKYES { | ||
2537 | register: VolatileCell<u16>, | ||
2538 | } | ||
2539 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2540 | pub mod tcd15_biter_elinkyes; | ||
2541 | #[doc = "TCD Source Address"] | ||
2542 | pub struct TCD16_SADDR { | ||
2543 | register: VolatileCell<u32>, | ||
2544 | } | ||
2545 | #[doc = "TCD Source Address"] | ||
2546 | pub mod tcd16_saddr; | ||
2547 | #[doc = "TCD Signed Source Address Offset"] | ||
2548 | pub struct TCD16_SOFF { | ||
2549 | register: VolatileCell<u16>, | ||
2550 | } | ||
2551 | #[doc = "TCD Signed Source Address Offset"] | ||
2552 | pub mod tcd16_soff; | ||
2553 | #[doc = "TCD Transfer Attributes"] | ||
2554 | pub struct TCD16_ATTR { | ||
2555 | register: VolatileCell<u16>, | ||
2556 | } | ||
2557 | #[doc = "TCD Transfer Attributes"] | ||
2558 | pub mod tcd16_attr; | ||
2559 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2560 | pub struct TCD16_NBYTES_MLNO { | ||
2561 | register: VolatileCell<u32>, | ||
2562 | } | ||
2563 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2564 | pub mod tcd16_nbytes_mlno; | ||
2565 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2566 | pub struct TCD16_NBYTES_MLOFFNO { | ||
2567 | register: VolatileCell<u32>, | ||
2568 | } | ||
2569 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2570 | pub mod tcd16_nbytes_mloffno; | ||
2571 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2572 | pub struct TCD16_NBYTES_MLOFFYES { | ||
2573 | register: VolatileCell<u32>, | ||
2574 | } | ||
2575 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2576 | pub mod tcd16_nbytes_mloffyes; | ||
2577 | #[doc = "TCD Last Source Address Adjustment"] | ||
2578 | pub struct TCD16_SLAST { | ||
2579 | register: VolatileCell<u32>, | ||
2580 | } | ||
2581 | #[doc = "TCD Last Source Address Adjustment"] | ||
2582 | pub mod tcd16_slast; | ||
2583 | #[doc = "TCD Destination Address"] | ||
2584 | pub struct TCD16_DADDR { | ||
2585 | register: VolatileCell<u32>, | ||
2586 | } | ||
2587 | #[doc = "TCD Destination Address"] | ||
2588 | pub mod tcd16_daddr; | ||
2589 | #[doc = "TCD Signed Destination Address Offset"] | ||
2590 | pub struct TCD16_DOFF { | ||
2591 | register: VolatileCell<u16>, | ||
2592 | } | ||
2593 | #[doc = "TCD Signed Destination Address Offset"] | ||
2594 | pub mod tcd16_doff; | ||
2595 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2596 | pub struct TCD16_CITER_ELINKNO { | ||
2597 | register: VolatileCell<u16>, | ||
2598 | } | ||
2599 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2600 | pub mod tcd16_citer_elinkno; | ||
2601 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2602 | pub struct TCD16_CITER_ELINKYES { | ||
2603 | register: VolatileCell<u16>, | ||
2604 | } | ||
2605 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2606 | pub mod tcd16_citer_elinkyes; | ||
2607 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2608 | pub struct TCD16_DLASTSGA { | ||
2609 | register: VolatileCell<u32>, | ||
2610 | } | ||
2611 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2612 | pub mod tcd16_dlastsga; | ||
2613 | #[doc = "TCD Control and Status"] | ||
2614 | pub struct TCD16_CSR { | ||
2615 | register: VolatileCell<u16>, | ||
2616 | } | ||
2617 | #[doc = "TCD Control and Status"] | ||
2618 | pub mod tcd16_csr; | ||
2619 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2620 | pub struct TCD16_BITER_ELINKNO { | ||
2621 | register: VolatileCell<u16>, | ||
2622 | } | ||
2623 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2624 | pub mod tcd16_biter_elinkno; | ||
2625 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2626 | pub struct TCD16_BITER_ELINKYES { | ||
2627 | register: VolatileCell<u16>, | ||
2628 | } | ||
2629 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2630 | pub mod tcd16_biter_elinkyes; | ||
2631 | #[doc = "TCD Source Address"] | ||
2632 | pub struct TCD17_SADDR { | ||
2633 | register: VolatileCell<u32>, | ||
2634 | } | ||
2635 | #[doc = "TCD Source Address"] | ||
2636 | pub mod tcd17_saddr; | ||
2637 | #[doc = "TCD Signed Source Address Offset"] | ||
2638 | pub struct TCD17_SOFF { | ||
2639 | register: VolatileCell<u16>, | ||
2640 | } | ||
2641 | #[doc = "TCD Signed Source Address Offset"] | ||
2642 | pub mod tcd17_soff; | ||
2643 | #[doc = "TCD Transfer Attributes"] | ||
2644 | pub struct TCD17_ATTR { | ||
2645 | register: VolatileCell<u16>, | ||
2646 | } | ||
2647 | #[doc = "TCD Transfer Attributes"] | ||
2648 | pub mod tcd17_attr; | ||
2649 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2650 | pub struct TCD17_NBYTES_MLNO { | ||
2651 | register: VolatileCell<u32>, | ||
2652 | } | ||
2653 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2654 | pub mod tcd17_nbytes_mlno; | ||
2655 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2656 | pub struct TCD17_NBYTES_MLOFFNO { | ||
2657 | register: VolatileCell<u32>, | ||
2658 | } | ||
2659 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2660 | pub mod tcd17_nbytes_mloffno; | ||
2661 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2662 | pub struct TCD17_NBYTES_MLOFFYES { | ||
2663 | register: VolatileCell<u32>, | ||
2664 | } | ||
2665 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2666 | pub mod tcd17_nbytes_mloffyes; | ||
2667 | #[doc = "TCD Last Source Address Adjustment"] | ||
2668 | pub struct TCD17_SLAST { | ||
2669 | register: VolatileCell<u32>, | ||
2670 | } | ||
2671 | #[doc = "TCD Last Source Address Adjustment"] | ||
2672 | pub mod tcd17_slast; | ||
2673 | #[doc = "TCD Destination Address"] | ||
2674 | pub struct TCD17_DADDR { | ||
2675 | register: VolatileCell<u32>, | ||
2676 | } | ||
2677 | #[doc = "TCD Destination Address"] | ||
2678 | pub mod tcd17_daddr; | ||
2679 | #[doc = "TCD Signed Destination Address Offset"] | ||
2680 | pub struct TCD17_DOFF { | ||
2681 | register: VolatileCell<u16>, | ||
2682 | } | ||
2683 | #[doc = "TCD Signed Destination Address Offset"] | ||
2684 | pub mod tcd17_doff; | ||
2685 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2686 | pub struct TCD17_CITER_ELINKNO { | ||
2687 | register: VolatileCell<u16>, | ||
2688 | } | ||
2689 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2690 | pub mod tcd17_citer_elinkno; | ||
2691 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2692 | pub struct TCD17_CITER_ELINKYES { | ||
2693 | register: VolatileCell<u16>, | ||
2694 | } | ||
2695 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2696 | pub mod tcd17_citer_elinkyes; | ||
2697 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2698 | pub struct TCD17_DLASTSGA { | ||
2699 | register: VolatileCell<u32>, | ||
2700 | } | ||
2701 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2702 | pub mod tcd17_dlastsga; | ||
2703 | #[doc = "TCD Control and Status"] | ||
2704 | pub struct TCD17_CSR { | ||
2705 | register: VolatileCell<u16>, | ||
2706 | } | ||
2707 | #[doc = "TCD Control and Status"] | ||
2708 | pub mod tcd17_csr; | ||
2709 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2710 | pub struct TCD17_BITER_ELINKNO { | ||
2711 | register: VolatileCell<u16>, | ||
2712 | } | ||
2713 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2714 | pub mod tcd17_biter_elinkno; | ||
2715 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2716 | pub struct TCD17_BITER_ELINKYES { | ||
2717 | register: VolatileCell<u16>, | ||
2718 | } | ||
2719 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2720 | pub mod tcd17_biter_elinkyes; | ||
2721 | #[doc = "TCD Source Address"] | ||
2722 | pub struct TCD18_SADDR { | ||
2723 | register: VolatileCell<u32>, | ||
2724 | } | ||
2725 | #[doc = "TCD Source Address"] | ||
2726 | pub mod tcd18_saddr; | ||
2727 | #[doc = "TCD Signed Source Address Offset"] | ||
2728 | pub struct TCD18_SOFF { | ||
2729 | register: VolatileCell<u16>, | ||
2730 | } | ||
2731 | #[doc = "TCD Signed Source Address Offset"] | ||
2732 | pub mod tcd18_soff; | ||
2733 | #[doc = "TCD Transfer Attributes"] | ||
2734 | pub struct TCD18_ATTR { | ||
2735 | register: VolatileCell<u16>, | ||
2736 | } | ||
2737 | #[doc = "TCD Transfer Attributes"] | ||
2738 | pub mod tcd18_attr; | ||
2739 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2740 | pub struct TCD18_NBYTES_MLNO { | ||
2741 | register: VolatileCell<u32>, | ||
2742 | } | ||
2743 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2744 | pub mod tcd18_nbytes_mlno; | ||
2745 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2746 | pub struct TCD18_NBYTES_MLOFFNO { | ||
2747 | register: VolatileCell<u32>, | ||
2748 | } | ||
2749 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2750 | pub mod tcd18_nbytes_mloffno; | ||
2751 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2752 | pub struct TCD18_NBYTES_MLOFFYES { | ||
2753 | register: VolatileCell<u32>, | ||
2754 | } | ||
2755 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2756 | pub mod tcd18_nbytes_mloffyes; | ||
2757 | #[doc = "TCD Last Source Address Adjustment"] | ||
2758 | pub struct TCD18_SLAST { | ||
2759 | register: VolatileCell<u32>, | ||
2760 | } | ||
2761 | #[doc = "TCD Last Source Address Adjustment"] | ||
2762 | pub mod tcd18_slast; | ||
2763 | #[doc = "TCD Destination Address"] | ||
2764 | pub struct TCD18_DADDR { | ||
2765 | register: VolatileCell<u32>, | ||
2766 | } | ||
2767 | #[doc = "TCD Destination Address"] | ||
2768 | pub mod tcd18_daddr; | ||
2769 | #[doc = "TCD Signed Destination Address Offset"] | ||
2770 | pub struct TCD18_DOFF { | ||
2771 | register: VolatileCell<u16>, | ||
2772 | } | ||
2773 | #[doc = "TCD Signed Destination Address Offset"] | ||
2774 | pub mod tcd18_doff; | ||
2775 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2776 | pub struct TCD18_CITER_ELINKNO { | ||
2777 | register: VolatileCell<u16>, | ||
2778 | } | ||
2779 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2780 | pub mod tcd18_citer_elinkno; | ||
2781 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2782 | pub struct TCD18_CITER_ELINKYES { | ||
2783 | register: VolatileCell<u16>, | ||
2784 | } | ||
2785 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2786 | pub mod tcd18_citer_elinkyes; | ||
2787 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2788 | pub struct TCD18_DLASTSGA { | ||
2789 | register: VolatileCell<u32>, | ||
2790 | } | ||
2791 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2792 | pub mod tcd18_dlastsga; | ||
2793 | #[doc = "TCD Control and Status"] | ||
2794 | pub struct TCD18_CSR { | ||
2795 | register: VolatileCell<u16>, | ||
2796 | } | ||
2797 | #[doc = "TCD Control and Status"] | ||
2798 | pub mod tcd18_csr; | ||
2799 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2800 | pub struct TCD18_BITER_ELINKNO { | ||
2801 | register: VolatileCell<u16>, | ||
2802 | } | ||
2803 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2804 | pub mod tcd18_biter_elinkno; | ||
2805 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2806 | pub struct TCD18_BITER_ELINKYES { | ||
2807 | register: VolatileCell<u16>, | ||
2808 | } | ||
2809 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2810 | pub mod tcd18_biter_elinkyes; | ||
2811 | #[doc = "TCD Source Address"] | ||
2812 | pub struct TCD19_SADDR { | ||
2813 | register: VolatileCell<u32>, | ||
2814 | } | ||
2815 | #[doc = "TCD Source Address"] | ||
2816 | pub mod tcd19_saddr; | ||
2817 | #[doc = "TCD Signed Source Address Offset"] | ||
2818 | pub struct TCD19_SOFF { | ||
2819 | register: VolatileCell<u16>, | ||
2820 | } | ||
2821 | #[doc = "TCD Signed Source Address Offset"] | ||
2822 | pub mod tcd19_soff; | ||
2823 | #[doc = "TCD Transfer Attributes"] | ||
2824 | pub struct TCD19_ATTR { | ||
2825 | register: VolatileCell<u16>, | ||
2826 | } | ||
2827 | #[doc = "TCD Transfer Attributes"] | ||
2828 | pub mod tcd19_attr; | ||
2829 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2830 | pub struct TCD19_NBYTES_MLNO { | ||
2831 | register: VolatileCell<u32>, | ||
2832 | } | ||
2833 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2834 | pub mod tcd19_nbytes_mlno; | ||
2835 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2836 | pub struct TCD19_NBYTES_MLOFFNO { | ||
2837 | register: VolatileCell<u32>, | ||
2838 | } | ||
2839 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2840 | pub mod tcd19_nbytes_mloffno; | ||
2841 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2842 | pub struct TCD19_NBYTES_MLOFFYES { | ||
2843 | register: VolatileCell<u32>, | ||
2844 | } | ||
2845 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2846 | pub mod tcd19_nbytes_mloffyes; | ||
2847 | #[doc = "TCD Last Source Address Adjustment"] | ||
2848 | pub struct TCD19_SLAST { | ||
2849 | register: VolatileCell<u32>, | ||
2850 | } | ||
2851 | #[doc = "TCD Last Source Address Adjustment"] | ||
2852 | pub mod tcd19_slast; | ||
2853 | #[doc = "TCD Destination Address"] | ||
2854 | pub struct TCD19_DADDR { | ||
2855 | register: VolatileCell<u32>, | ||
2856 | } | ||
2857 | #[doc = "TCD Destination Address"] | ||
2858 | pub mod tcd19_daddr; | ||
2859 | #[doc = "TCD Signed Destination Address Offset"] | ||
2860 | pub struct TCD19_DOFF { | ||
2861 | register: VolatileCell<u16>, | ||
2862 | } | ||
2863 | #[doc = "TCD Signed Destination Address Offset"] | ||
2864 | pub mod tcd19_doff; | ||
2865 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2866 | pub struct TCD19_CITER_ELINKNO { | ||
2867 | register: VolatileCell<u16>, | ||
2868 | } | ||
2869 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2870 | pub mod tcd19_citer_elinkno; | ||
2871 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2872 | pub struct TCD19_CITER_ELINKYES { | ||
2873 | register: VolatileCell<u16>, | ||
2874 | } | ||
2875 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2876 | pub mod tcd19_citer_elinkyes; | ||
2877 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2878 | pub struct TCD19_DLASTSGA { | ||
2879 | register: VolatileCell<u32>, | ||
2880 | } | ||
2881 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2882 | pub mod tcd19_dlastsga; | ||
2883 | #[doc = "TCD Control and Status"] | ||
2884 | pub struct TCD19_CSR { | ||
2885 | register: VolatileCell<u16>, | ||
2886 | } | ||
2887 | #[doc = "TCD Control and Status"] | ||
2888 | pub mod tcd19_csr; | ||
2889 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2890 | pub struct TCD19_BITER_ELINKNO { | ||
2891 | register: VolatileCell<u16>, | ||
2892 | } | ||
2893 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2894 | pub mod tcd19_biter_elinkno; | ||
2895 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2896 | pub struct TCD19_BITER_ELINKYES { | ||
2897 | register: VolatileCell<u16>, | ||
2898 | } | ||
2899 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2900 | pub mod tcd19_biter_elinkyes; | ||
2901 | #[doc = "TCD Source Address"] | ||
2902 | pub struct TCD20_SADDR { | ||
2903 | register: VolatileCell<u32>, | ||
2904 | } | ||
2905 | #[doc = "TCD Source Address"] | ||
2906 | pub mod tcd20_saddr; | ||
2907 | #[doc = "TCD Signed Source Address Offset"] | ||
2908 | pub struct TCD20_SOFF { | ||
2909 | register: VolatileCell<u16>, | ||
2910 | } | ||
2911 | #[doc = "TCD Signed Source Address Offset"] | ||
2912 | pub mod tcd20_soff; | ||
2913 | #[doc = "TCD Transfer Attributes"] | ||
2914 | pub struct TCD20_ATTR { | ||
2915 | register: VolatileCell<u16>, | ||
2916 | } | ||
2917 | #[doc = "TCD Transfer Attributes"] | ||
2918 | pub mod tcd20_attr; | ||
2919 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2920 | pub struct TCD20_NBYTES_MLNO { | ||
2921 | register: VolatileCell<u32>, | ||
2922 | } | ||
2923 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2924 | pub mod tcd20_nbytes_mlno; | ||
2925 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2926 | pub struct TCD20_NBYTES_MLOFFNO { | ||
2927 | register: VolatileCell<u32>, | ||
2928 | } | ||
2929 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2930 | pub mod tcd20_nbytes_mloffno; | ||
2931 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2932 | pub struct TCD20_NBYTES_MLOFFYES { | ||
2933 | register: VolatileCell<u32>, | ||
2934 | } | ||
2935 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2936 | pub mod tcd20_nbytes_mloffyes; | ||
2937 | #[doc = "TCD Last Source Address Adjustment"] | ||
2938 | pub struct TCD20_SLAST { | ||
2939 | register: VolatileCell<u32>, | ||
2940 | } | ||
2941 | #[doc = "TCD Last Source Address Adjustment"] | ||
2942 | pub mod tcd20_slast; | ||
2943 | #[doc = "TCD Destination Address"] | ||
2944 | pub struct TCD20_DADDR { | ||
2945 | register: VolatileCell<u32>, | ||
2946 | } | ||
2947 | #[doc = "TCD Destination Address"] | ||
2948 | pub mod tcd20_daddr; | ||
2949 | #[doc = "TCD Signed Destination Address Offset"] | ||
2950 | pub struct TCD20_DOFF { | ||
2951 | register: VolatileCell<u16>, | ||
2952 | } | ||
2953 | #[doc = "TCD Signed Destination Address Offset"] | ||
2954 | pub mod tcd20_doff; | ||
2955 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2956 | pub struct TCD20_CITER_ELINKNO { | ||
2957 | register: VolatileCell<u16>, | ||
2958 | } | ||
2959 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2960 | pub mod tcd20_citer_elinkno; | ||
2961 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2962 | pub struct TCD20_CITER_ELINKYES { | ||
2963 | register: VolatileCell<u16>, | ||
2964 | } | ||
2965 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2966 | pub mod tcd20_citer_elinkyes; | ||
2967 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2968 | pub struct TCD20_DLASTSGA { | ||
2969 | register: VolatileCell<u32>, | ||
2970 | } | ||
2971 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2972 | pub mod tcd20_dlastsga; | ||
2973 | #[doc = "TCD Control and Status"] | ||
2974 | pub struct TCD20_CSR { | ||
2975 | register: VolatileCell<u16>, | ||
2976 | } | ||
2977 | #[doc = "TCD Control and Status"] | ||
2978 | pub mod tcd20_csr; | ||
2979 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2980 | pub struct TCD20_BITER_ELINKNO { | ||
2981 | register: VolatileCell<u16>, | ||
2982 | } | ||
2983 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2984 | pub mod tcd20_biter_elinkno; | ||
2985 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2986 | pub struct TCD20_BITER_ELINKYES { | ||
2987 | register: VolatileCell<u16>, | ||
2988 | } | ||
2989 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2990 | pub mod tcd20_biter_elinkyes; | ||
2991 | #[doc = "TCD Source Address"] | ||
2992 | pub struct TCD21_SADDR { | ||
2993 | register: VolatileCell<u32>, | ||
2994 | } | ||
2995 | #[doc = "TCD Source Address"] | ||
2996 | pub mod tcd21_saddr; | ||
2997 | #[doc = "TCD Signed Source Address Offset"] | ||
2998 | pub struct TCD21_SOFF { | ||
2999 | register: VolatileCell<u16>, | ||
3000 | } | ||
3001 | #[doc = "TCD Signed Source Address Offset"] | ||
3002 | pub mod tcd21_soff; | ||
3003 | #[doc = "TCD Transfer Attributes"] | ||
3004 | pub struct TCD21_ATTR { | ||
3005 | register: VolatileCell<u16>, | ||
3006 | } | ||
3007 | #[doc = "TCD Transfer Attributes"] | ||
3008 | pub mod tcd21_attr; | ||
3009 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3010 | pub struct TCD21_NBYTES_MLNO { | ||
3011 | register: VolatileCell<u32>, | ||
3012 | } | ||
3013 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3014 | pub mod tcd21_nbytes_mlno; | ||
3015 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3016 | pub struct TCD21_NBYTES_MLOFFNO { | ||
3017 | register: VolatileCell<u32>, | ||
3018 | } | ||
3019 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3020 | pub mod tcd21_nbytes_mloffno; | ||
3021 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3022 | pub struct TCD21_NBYTES_MLOFFYES { | ||
3023 | register: VolatileCell<u32>, | ||
3024 | } | ||
3025 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3026 | pub mod tcd21_nbytes_mloffyes; | ||
3027 | #[doc = "TCD Last Source Address Adjustment"] | ||
3028 | pub struct TCD21_SLAST { | ||
3029 | register: VolatileCell<u32>, | ||
3030 | } | ||
3031 | #[doc = "TCD Last Source Address Adjustment"] | ||
3032 | pub mod tcd21_slast; | ||
3033 | #[doc = "TCD Destination Address"] | ||
3034 | pub struct TCD21_DADDR { | ||
3035 | register: VolatileCell<u32>, | ||
3036 | } | ||
3037 | #[doc = "TCD Destination Address"] | ||
3038 | pub mod tcd21_daddr; | ||
3039 | #[doc = "TCD Signed Destination Address Offset"] | ||
3040 | pub struct TCD21_DOFF { | ||
3041 | register: VolatileCell<u16>, | ||
3042 | } | ||
3043 | #[doc = "TCD Signed Destination Address Offset"] | ||
3044 | pub mod tcd21_doff; | ||
3045 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3046 | pub struct TCD21_CITER_ELINKNO { | ||
3047 | register: VolatileCell<u16>, | ||
3048 | } | ||
3049 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3050 | pub mod tcd21_citer_elinkno; | ||
3051 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3052 | pub struct TCD21_CITER_ELINKYES { | ||
3053 | register: VolatileCell<u16>, | ||
3054 | } | ||
3055 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3056 | pub mod tcd21_citer_elinkyes; | ||
3057 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3058 | pub struct TCD21_DLASTSGA { | ||
3059 | register: VolatileCell<u32>, | ||
3060 | } | ||
3061 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3062 | pub mod tcd21_dlastsga; | ||
3063 | #[doc = "TCD Control and Status"] | ||
3064 | pub struct TCD21_CSR { | ||
3065 | register: VolatileCell<u16>, | ||
3066 | } | ||
3067 | #[doc = "TCD Control and Status"] | ||
3068 | pub mod tcd21_csr; | ||
3069 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3070 | pub struct TCD21_BITER_ELINKNO { | ||
3071 | register: VolatileCell<u16>, | ||
3072 | } | ||
3073 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3074 | pub mod tcd21_biter_elinkno; | ||
3075 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3076 | pub struct TCD21_BITER_ELINKYES { | ||
3077 | register: VolatileCell<u16>, | ||
3078 | } | ||
3079 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3080 | pub mod tcd21_biter_elinkyes; | ||
3081 | #[doc = "TCD Source Address"] | ||
3082 | pub struct TCD22_SADDR { | ||
3083 | register: VolatileCell<u32>, | ||
3084 | } | ||
3085 | #[doc = "TCD Source Address"] | ||
3086 | pub mod tcd22_saddr; | ||
3087 | #[doc = "TCD Signed Source Address Offset"] | ||
3088 | pub struct TCD22_SOFF { | ||
3089 | register: VolatileCell<u16>, | ||
3090 | } | ||
3091 | #[doc = "TCD Signed Source Address Offset"] | ||
3092 | pub mod tcd22_soff; | ||
3093 | #[doc = "TCD Transfer Attributes"] | ||
3094 | pub struct TCD22_ATTR { | ||
3095 | register: VolatileCell<u16>, | ||
3096 | } | ||
3097 | #[doc = "TCD Transfer Attributes"] | ||
3098 | pub mod tcd22_attr; | ||
3099 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3100 | pub struct TCD22_NBYTES_MLNO { | ||
3101 | register: VolatileCell<u32>, | ||
3102 | } | ||
3103 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3104 | pub mod tcd22_nbytes_mlno; | ||
3105 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3106 | pub struct TCD22_NBYTES_MLOFFNO { | ||
3107 | register: VolatileCell<u32>, | ||
3108 | } | ||
3109 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3110 | pub mod tcd22_nbytes_mloffno; | ||
3111 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3112 | pub struct TCD22_NBYTES_MLOFFYES { | ||
3113 | register: VolatileCell<u32>, | ||
3114 | } | ||
3115 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3116 | pub mod tcd22_nbytes_mloffyes; | ||
3117 | #[doc = "TCD Last Source Address Adjustment"] | ||
3118 | pub struct TCD22_SLAST { | ||
3119 | register: VolatileCell<u32>, | ||
3120 | } | ||
3121 | #[doc = "TCD Last Source Address Adjustment"] | ||
3122 | pub mod tcd22_slast; | ||
3123 | #[doc = "TCD Destination Address"] | ||
3124 | pub struct TCD22_DADDR { | ||
3125 | register: VolatileCell<u32>, | ||
3126 | } | ||
3127 | #[doc = "TCD Destination Address"] | ||
3128 | pub mod tcd22_daddr; | ||
3129 | #[doc = "TCD Signed Destination Address Offset"] | ||
3130 | pub struct TCD22_DOFF { | ||
3131 | register: VolatileCell<u16>, | ||
3132 | } | ||
3133 | #[doc = "TCD Signed Destination Address Offset"] | ||
3134 | pub mod tcd22_doff; | ||
3135 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3136 | pub struct TCD22_CITER_ELINKNO { | ||
3137 | register: VolatileCell<u16>, | ||
3138 | } | ||
3139 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3140 | pub mod tcd22_citer_elinkno; | ||
3141 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3142 | pub struct TCD22_CITER_ELINKYES { | ||
3143 | register: VolatileCell<u16>, | ||
3144 | } | ||
3145 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3146 | pub mod tcd22_citer_elinkyes; | ||
3147 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3148 | pub struct TCD22_DLASTSGA { | ||
3149 | register: VolatileCell<u32>, | ||
3150 | } | ||
3151 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3152 | pub mod tcd22_dlastsga; | ||
3153 | #[doc = "TCD Control and Status"] | ||
3154 | pub struct TCD22_CSR { | ||
3155 | register: VolatileCell<u16>, | ||
3156 | } | ||
3157 | #[doc = "TCD Control and Status"] | ||
3158 | pub mod tcd22_csr; | ||
3159 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3160 | pub struct TCD22_BITER_ELINKNO { | ||
3161 | register: VolatileCell<u16>, | ||
3162 | } | ||
3163 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3164 | pub mod tcd22_biter_elinkno; | ||
3165 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3166 | pub struct TCD22_BITER_ELINKYES { | ||
3167 | register: VolatileCell<u16>, | ||
3168 | } | ||
3169 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3170 | pub mod tcd22_biter_elinkyes; | ||
3171 | #[doc = "TCD Source Address"] | ||
3172 | pub struct TCD23_SADDR { | ||
3173 | register: VolatileCell<u32>, | ||
3174 | } | ||
3175 | #[doc = "TCD Source Address"] | ||
3176 | pub mod tcd23_saddr; | ||
3177 | #[doc = "TCD Signed Source Address Offset"] | ||
3178 | pub struct TCD23_SOFF { | ||
3179 | register: VolatileCell<u16>, | ||
3180 | } | ||
3181 | #[doc = "TCD Signed Source Address Offset"] | ||
3182 | pub mod tcd23_soff; | ||
3183 | #[doc = "TCD Transfer Attributes"] | ||
3184 | pub struct TCD23_ATTR { | ||
3185 | register: VolatileCell<u16>, | ||
3186 | } | ||
3187 | #[doc = "TCD Transfer Attributes"] | ||
3188 | pub mod tcd23_attr; | ||
3189 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3190 | pub struct TCD23_NBYTES_MLNO { | ||
3191 | register: VolatileCell<u32>, | ||
3192 | } | ||
3193 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3194 | pub mod tcd23_nbytes_mlno; | ||
3195 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3196 | pub struct TCD23_NBYTES_MLOFFNO { | ||
3197 | register: VolatileCell<u32>, | ||
3198 | } | ||
3199 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3200 | pub mod tcd23_nbytes_mloffno; | ||
3201 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3202 | pub struct TCD23_NBYTES_MLOFFYES { | ||
3203 | register: VolatileCell<u32>, | ||
3204 | } | ||
3205 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3206 | pub mod tcd23_nbytes_mloffyes; | ||
3207 | #[doc = "TCD Last Source Address Adjustment"] | ||
3208 | pub struct TCD23_SLAST { | ||
3209 | register: VolatileCell<u32>, | ||
3210 | } | ||
3211 | #[doc = "TCD Last Source Address Adjustment"] | ||
3212 | pub mod tcd23_slast; | ||
3213 | #[doc = "TCD Destination Address"] | ||
3214 | pub struct TCD23_DADDR { | ||
3215 | register: VolatileCell<u32>, | ||
3216 | } | ||
3217 | #[doc = "TCD Destination Address"] | ||
3218 | pub mod tcd23_daddr; | ||
3219 | #[doc = "TCD Signed Destination Address Offset"] | ||
3220 | pub struct TCD23_DOFF { | ||
3221 | register: VolatileCell<u16>, | ||
3222 | } | ||
3223 | #[doc = "TCD Signed Destination Address Offset"] | ||
3224 | pub mod tcd23_doff; | ||
3225 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3226 | pub struct TCD23_CITER_ELINKNO { | ||
3227 | register: VolatileCell<u16>, | ||
3228 | } | ||
3229 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3230 | pub mod tcd23_citer_elinkno; | ||
3231 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3232 | pub struct TCD23_CITER_ELINKYES { | ||
3233 | register: VolatileCell<u16>, | ||
3234 | } | ||
3235 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3236 | pub mod tcd23_citer_elinkyes; | ||
3237 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3238 | pub struct TCD23_DLASTSGA { | ||
3239 | register: VolatileCell<u32>, | ||
3240 | } | ||
3241 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3242 | pub mod tcd23_dlastsga; | ||
3243 | #[doc = "TCD Control and Status"] | ||
3244 | pub struct TCD23_CSR { | ||
3245 | register: VolatileCell<u16>, | ||
3246 | } | ||
3247 | #[doc = "TCD Control and Status"] | ||
3248 | pub mod tcd23_csr; | ||
3249 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3250 | pub struct TCD23_BITER_ELINKNO { | ||
3251 | register: VolatileCell<u16>, | ||
3252 | } | ||
3253 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3254 | pub mod tcd23_biter_elinkno; | ||
3255 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3256 | pub struct TCD23_BITER_ELINKYES { | ||
3257 | register: VolatileCell<u16>, | ||
3258 | } | ||
3259 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3260 | pub mod tcd23_biter_elinkyes; | ||
3261 | #[doc = "TCD Source Address"] | ||
3262 | pub struct TCD24_SADDR { | ||
3263 | register: VolatileCell<u32>, | ||
3264 | } | ||
3265 | #[doc = "TCD Source Address"] | ||
3266 | pub mod tcd24_saddr; | ||
3267 | #[doc = "TCD Signed Source Address Offset"] | ||
3268 | pub struct TCD24_SOFF { | ||
3269 | register: VolatileCell<u16>, | ||
3270 | } | ||
3271 | #[doc = "TCD Signed Source Address Offset"] | ||
3272 | pub mod tcd24_soff; | ||
3273 | #[doc = "TCD Transfer Attributes"] | ||
3274 | pub struct TCD24_ATTR { | ||
3275 | register: VolatileCell<u16>, | ||
3276 | } | ||
3277 | #[doc = "TCD Transfer Attributes"] | ||
3278 | pub mod tcd24_attr; | ||
3279 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3280 | pub struct TCD24_NBYTES_MLNO { | ||
3281 | register: VolatileCell<u32>, | ||
3282 | } | ||
3283 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3284 | pub mod tcd24_nbytes_mlno; | ||
3285 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3286 | pub struct TCD24_NBYTES_MLOFFNO { | ||
3287 | register: VolatileCell<u32>, | ||
3288 | } | ||
3289 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3290 | pub mod tcd24_nbytes_mloffno; | ||
3291 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3292 | pub struct TCD24_NBYTES_MLOFFYES { | ||
3293 | register: VolatileCell<u32>, | ||
3294 | } | ||
3295 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3296 | pub mod tcd24_nbytes_mloffyes; | ||
3297 | #[doc = "TCD Last Source Address Adjustment"] | ||
3298 | pub struct TCD24_SLAST { | ||
3299 | register: VolatileCell<u32>, | ||
3300 | } | ||
3301 | #[doc = "TCD Last Source Address Adjustment"] | ||
3302 | pub mod tcd24_slast; | ||
3303 | #[doc = "TCD Destination Address"] | ||
3304 | pub struct TCD24_DADDR { | ||
3305 | register: VolatileCell<u32>, | ||
3306 | } | ||
3307 | #[doc = "TCD Destination Address"] | ||
3308 | pub mod tcd24_daddr; | ||
3309 | #[doc = "TCD Signed Destination Address Offset"] | ||
3310 | pub struct TCD24_DOFF { | ||
3311 | register: VolatileCell<u16>, | ||
3312 | } | ||
3313 | #[doc = "TCD Signed Destination Address Offset"] | ||
3314 | pub mod tcd24_doff; | ||
3315 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3316 | pub struct TCD24_CITER_ELINKNO { | ||
3317 | register: VolatileCell<u16>, | ||
3318 | } | ||
3319 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3320 | pub mod tcd24_citer_elinkno; | ||
3321 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3322 | pub struct TCD24_CITER_ELINKYES { | ||
3323 | register: VolatileCell<u16>, | ||
3324 | } | ||
3325 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3326 | pub mod tcd24_citer_elinkyes; | ||
3327 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3328 | pub struct TCD24_DLASTSGA { | ||
3329 | register: VolatileCell<u32>, | ||
3330 | } | ||
3331 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3332 | pub mod tcd24_dlastsga; | ||
3333 | #[doc = "TCD Control and Status"] | ||
3334 | pub struct TCD24_CSR { | ||
3335 | register: VolatileCell<u16>, | ||
3336 | } | ||
3337 | #[doc = "TCD Control and Status"] | ||
3338 | pub mod tcd24_csr; | ||
3339 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3340 | pub struct TCD24_BITER_ELINKNO { | ||
3341 | register: VolatileCell<u16>, | ||
3342 | } | ||
3343 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3344 | pub mod tcd24_biter_elinkno; | ||
3345 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3346 | pub struct TCD24_BITER_ELINKYES { | ||
3347 | register: VolatileCell<u16>, | ||
3348 | } | ||
3349 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3350 | pub mod tcd24_biter_elinkyes; | ||
3351 | #[doc = "TCD Source Address"] | ||
3352 | pub struct TCD25_SADDR { | ||
3353 | register: VolatileCell<u32>, | ||
3354 | } | ||
3355 | #[doc = "TCD Source Address"] | ||
3356 | pub mod tcd25_saddr; | ||
3357 | #[doc = "TCD Signed Source Address Offset"] | ||
3358 | pub struct TCD25_SOFF { | ||
3359 | register: VolatileCell<u16>, | ||
3360 | } | ||
3361 | #[doc = "TCD Signed Source Address Offset"] | ||
3362 | pub mod tcd25_soff; | ||
3363 | #[doc = "TCD Transfer Attributes"] | ||
3364 | pub struct TCD25_ATTR { | ||
3365 | register: VolatileCell<u16>, | ||
3366 | } | ||
3367 | #[doc = "TCD Transfer Attributes"] | ||
3368 | pub mod tcd25_attr; | ||
3369 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3370 | pub struct TCD25_NBYTES_MLNO { | ||
3371 | register: VolatileCell<u32>, | ||
3372 | } | ||
3373 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3374 | pub mod tcd25_nbytes_mlno; | ||
3375 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3376 | pub struct TCD25_NBYTES_MLOFFNO { | ||
3377 | register: VolatileCell<u32>, | ||
3378 | } | ||
3379 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3380 | pub mod tcd25_nbytes_mloffno; | ||
3381 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3382 | pub struct TCD25_NBYTES_MLOFFYES { | ||
3383 | register: VolatileCell<u32>, | ||
3384 | } | ||
3385 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3386 | pub mod tcd25_nbytes_mloffyes; | ||
3387 | #[doc = "TCD Last Source Address Adjustment"] | ||
3388 | pub struct TCD25_SLAST { | ||
3389 | register: VolatileCell<u32>, | ||
3390 | } | ||
3391 | #[doc = "TCD Last Source Address Adjustment"] | ||
3392 | pub mod tcd25_slast; | ||
3393 | #[doc = "TCD Destination Address"] | ||
3394 | pub struct TCD25_DADDR { | ||
3395 | register: VolatileCell<u32>, | ||
3396 | } | ||
3397 | #[doc = "TCD Destination Address"] | ||
3398 | pub mod tcd25_daddr; | ||
3399 | #[doc = "TCD Signed Destination Address Offset"] | ||
3400 | pub struct TCD25_DOFF { | ||
3401 | register: VolatileCell<u16>, | ||
3402 | } | ||
3403 | #[doc = "TCD Signed Destination Address Offset"] | ||
3404 | pub mod tcd25_doff; | ||
3405 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3406 | pub struct TCD25_CITER_ELINKNO { | ||
3407 | register: VolatileCell<u16>, | ||
3408 | } | ||
3409 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3410 | pub mod tcd25_citer_elinkno; | ||
3411 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3412 | pub struct TCD25_CITER_ELINKYES { | ||
3413 | register: VolatileCell<u16>, | ||
3414 | } | ||
3415 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3416 | pub mod tcd25_citer_elinkyes; | ||
3417 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3418 | pub struct TCD25_DLASTSGA { | ||
3419 | register: VolatileCell<u32>, | ||
3420 | } | ||
3421 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3422 | pub mod tcd25_dlastsga; | ||
3423 | #[doc = "TCD Control and Status"] | ||
3424 | pub struct TCD25_CSR { | ||
3425 | register: VolatileCell<u16>, | ||
3426 | } | ||
3427 | #[doc = "TCD Control and Status"] | ||
3428 | pub mod tcd25_csr; | ||
3429 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3430 | pub struct TCD25_BITER_ELINKNO { | ||
3431 | register: VolatileCell<u16>, | ||
3432 | } | ||
3433 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3434 | pub mod tcd25_biter_elinkno; | ||
3435 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3436 | pub struct TCD25_BITER_ELINKYES { | ||
3437 | register: VolatileCell<u16>, | ||
3438 | } | ||
3439 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3440 | pub mod tcd25_biter_elinkyes; | ||
3441 | #[doc = "TCD Source Address"] | ||
3442 | pub struct TCD26_SADDR { | ||
3443 | register: VolatileCell<u32>, | ||
3444 | } | ||
3445 | #[doc = "TCD Source Address"] | ||
3446 | pub mod tcd26_saddr; | ||
3447 | #[doc = "TCD Signed Source Address Offset"] | ||
3448 | pub struct TCD26_SOFF { | ||
3449 | register: VolatileCell<u16>, | ||
3450 | } | ||
3451 | #[doc = "TCD Signed Source Address Offset"] | ||
3452 | pub mod tcd26_soff; | ||
3453 | #[doc = "TCD Transfer Attributes"] | ||
3454 | pub struct TCD26_ATTR { | ||
3455 | register: VolatileCell<u16>, | ||
3456 | } | ||
3457 | #[doc = "TCD Transfer Attributes"] | ||
3458 | pub mod tcd26_attr; | ||
3459 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3460 | pub struct TCD26_NBYTES_MLNO { | ||
3461 | register: VolatileCell<u32>, | ||
3462 | } | ||
3463 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3464 | pub mod tcd26_nbytes_mlno; | ||
3465 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3466 | pub struct TCD26_NBYTES_MLOFFNO { | ||
3467 | register: VolatileCell<u32>, | ||
3468 | } | ||
3469 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3470 | pub mod tcd26_nbytes_mloffno; | ||
3471 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3472 | pub struct TCD26_NBYTES_MLOFFYES { | ||
3473 | register: VolatileCell<u32>, | ||
3474 | } | ||
3475 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3476 | pub mod tcd26_nbytes_mloffyes; | ||
3477 | #[doc = "TCD Last Source Address Adjustment"] | ||
3478 | pub struct TCD26_SLAST { | ||
3479 | register: VolatileCell<u32>, | ||
3480 | } | ||
3481 | #[doc = "TCD Last Source Address Adjustment"] | ||
3482 | pub mod tcd26_slast; | ||
3483 | #[doc = "TCD Destination Address"] | ||
3484 | pub struct TCD26_DADDR { | ||
3485 | register: VolatileCell<u32>, | ||
3486 | } | ||
3487 | #[doc = "TCD Destination Address"] | ||
3488 | pub mod tcd26_daddr; | ||
3489 | #[doc = "TCD Signed Destination Address Offset"] | ||
3490 | pub struct TCD26_DOFF { | ||
3491 | register: VolatileCell<u16>, | ||
3492 | } | ||
3493 | #[doc = "TCD Signed Destination Address Offset"] | ||
3494 | pub mod tcd26_doff; | ||
3495 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3496 | pub struct TCD26_CITER_ELINKNO { | ||
3497 | register: VolatileCell<u16>, | ||
3498 | } | ||
3499 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3500 | pub mod tcd26_citer_elinkno; | ||
3501 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3502 | pub struct TCD26_CITER_ELINKYES { | ||
3503 | register: VolatileCell<u16>, | ||
3504 | } | ||
3505 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3506 | pub mod tcd26_citer_elinkyes; | ||
3507 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3508 | pub struct TCD26_DLASTSGA { | ||
3509 | register: VolatileCell<u32>, | ||
3510 | } | ||
3511 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3512 | pub mod tcd26_dlastsga; | ||
3513 | #[doc = "TCD Control and Status"] | ||
3514 | pub struct TCD26_CSR { | ||
3515 | register: VolatileCell<u16>, | ||
3516 | } | ||
3517 | #[doc = "TCD Control and Status"] | ||
3518 | pub mod tcd26_csr; | ||
3519 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3520 | pub struct TCD26_BITER_ELINKNO { | ||
3521 | register: VolatileCell<u16>, | ||
3522 | } | ||
3523 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3524 | pub mod tcd26_biter_elinkno; | ||
3525 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3526 | pub struct TCD26_BITER_ELINKYES { | ||
3527 | register: VolatileCell<u16>, | ||
3528 | } | ||
3529 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3530 | pub mod tcd26_biter_elinkyes; | ||
3531 | #[doc = "TCD Source Address"] | ||
3532 | pub struct TCD27_SADDR { | ||
3533 | register: VolatileCell<u32>, | ||
3534 | } | ||
3535 | #[doc = "TCD Source Address"] | ||
3536 | pub mod tcd27_saddr; | ||
3537 | #[doc = "TCD Signed Source Address Offset"] | ||
3538 | pub struct TCD27_SOFF { | ||
3539 | register: VolatileCell<u16>, | ||
3540 | } | ||
3541 | #[doc = "TCD Signed Source Address Offset"] | ||
3542 | pub mod tcd27_soff; | ||
3543 | #[doc = "TCD Transfer Attributes"] | ||
3544 | pub struct TCD27_ATTR { | ||
3545 | register: VolatileCell<u16>, | ||
3546 | } | ||
3547 | #[doc = "TCD Transfer Attributes"] | ||
3548 | pub mod tcd27_attr; | ||
3549 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3550 | pub struct TCD27_NBYTES_MLNO { | ||
3551 | register: VolatileCell<u32>, | ||
3552 | } | ||
3553 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3554 | pub mod tcd27_nbytes_mlno; | ||
3555 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3556 | pub struct TCD27_NBYTES_MLOFFNO { | ||
3557 | register: VolatileCell<u32>, | ||
3558 | } | ||
3559 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3560 | pub mod tcd27_nbytes_mloffno; | ||
3561 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3562 | pub struct TCD27_NBYTES_MLOFFYES { | ||
3563 | register: VolatileCell<u32>, | ||
3564 | } | ||
3565 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3566 | pub mod tcd27_nbytes_mloffyes; | ||
3567 | #[doc = "TCD Last Source Address Adjustment"] | ||
3568 | pub struct TCD27_SLAST { | ||
3569 | register: VolatileCell<u32>, | ||
3570 | } | ||
3571 | #[doc = "TCD Last Source Address Adjustment"] | ||
3572 | pub mod tcd27_slast; | ||
3573 | #[doc = "TCD Destination Address"] | ||
3574 | pub struct TCD27_DADDR { | ||
3575 | register: VolatileCell<u32>, | ||
3576 | } | ||
3577 | #[doc = "TCD Destination Address"] | ||
3578 | pub mod tcd27_daddr; | ||
3579 | #[doc = "TCD Signed Destination Address Offset"] | ||
3580 | pub struct TCD27_DOFF { | ||
3581 | register: VolatileCell<u16>, | ||
3582 | } | ||
3583 | #[doc = "TCD Signed Destination Address Offset"] | ||
3584 | pub mod tcd27_doff; | ||
3585 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3586 | pub struct TCD27_CITER_ELINKNO { | ||
3587 | register: VolatileCell<u16>, | ||
3588 | } | ||
3589 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3590 | pub mod tcd27_citer_elinkno; | ||
3591 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3592 | pub struct TCD27_CITER_ELINKYES { | ||
3593 | register: VolatileCell<u16>, | ||
3594 | } | ||
3595 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3596 | pub mod tcd27_citer_elinkyes; | ||
3597 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3598 | pub struct TCD27_DLASTSGA { | ||
3599 | register: VolatileCell<u32>, | ||
3600 | } | ||
3601 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3602 | pub mod tcd27_dlastsga; | ||
3603 | #[doc = "TCD Control and Status"] | ||
3604 | pub struct TCD27_CSR { | ||
3605 | register: VolatileCell<u16>, | ||
3606 | } | ||
3607 | #[doc = "TCD Control and Status"] | ||
3608 | pub mod tcd27_csr; | ||
3609 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3610 | pub struct TCD27_BITER_ELINKNO { | ||
3611 | register: VolatileCell<u16>, | ||
3612 | } | ||
3613 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3614 | pub mod tcd27_biter_elinkno; | ||
3615 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3616 | pub struct TCD27_BITER_ELINKYES { | ||
3617 | register: VolatileCell<u16>, | ||
3618 | } | ||
3619 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3620 | pub mod tcd27_biter_elinkyes; | ||
3621 | #[doc = "TCD Source Address"] | ||
3622 | pub struct TCD28_SADDR { | ||
3623 | register: VolatileCell<u32>, | ||
3624 | } | ||
3625 | #[doc = "TCD Source Address"] | ||
3626 | pub mod tcd28_saddr; | ||
3627 | #[doc = "TCD Signed Source Address Offset"] | ||
3628 | pub struct TCD28_SOFF { | ||
3629 | register: VolatileCell<u16>, | ||
3630 | } | ||
3631 | #[doc = "TCD Signed Source Address Offset"] | ||
3632 | pub mod tcd28_soff; | ||
3633 | #[doc = "TCD Transfer Attributes"] | ||
3634 | pub struct TCD28_ATTR { | ||
3635 | register: VolatileCell<u16>, | ||
3636 | } | ||
3637 | #[doc = "TCD Transfer Attributes"] | ||
3638 | pub mod tcd28_attr; | ||
3639 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3640 | pub struct TCD28_NBYTES_MLNO { | ||
3641 | register: VolatileCell<u32>, | ||
3642 | } | ||
3643 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3644 | pub mod tcd28_nbytes_mlno; | ||
3645 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3646 | pub struct TCD28_NBYTES_MLOFFNO { | ||
3647 | register: VolatileCell<u32>, | ||
3648 | } | ||
3649 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3650 | pub mod tcd28_nbytes_mloffno; | ||
3651 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3652 | pub struct TCD28_NBYTES_MLOFFYES { | ||
3653 | register: VolatileCell<u32>, | ||
3654 | } | ||
3655 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3656 | pub mod tcd28_nbytes_mloffyes; | ||
3657 | #[doc = "TCD Last Source Address Adjustment"] | ||
3658 | pub struct TCD28_SLAST { | ||
3659 | register: VolatileCell<u32>, | ||
3660 | } | ||
3661 | #[doc = "TCD Last Source Address Adjustment"] | ||
3662 | pub mod tcd28_slast; | ||
3663 | #[doc = "TCD Destination Address"] | ||
3664 | pub struct TCD28_DADDR { | ||
3665 | register: VolatileCell<u32>, | ||
3666 | } | ||
3667 | #[doc = "TCD Destination Address"] | ||
3668 | pub mod tcd28_daddr; | ||
3669 | #[doc = "TCD Signed Destination Address Offset"] | ||
3670 | pub struct TCD28_DOFF { | ||
3671 | register: VolatileCell<u16>, | ||
3672 | } | ||
3673 | #[doc = "TCD Signed Destination Address Offset"] | ||
3674 | pub mod tcd28_doff; | ||
3675 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3676 | pub struct TCD28_CITER_ELINKNO { | ||
3677 | register: VolatileCell<u16>, | ||
3678 | } | ||
3679 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3680 | pub mod tcd28_citer_elinkno; | ||
3681 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3682 | pub struct TCD28_CITER_ELINKYES { | ||
3683 | register: VolatileCell<u16>, | ||
3684 | } | ||
3685 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3686 | pub mod tcd28_citer_elinkyes; | ||
3687 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3688 | pub struct TCD28_DLASTSGA { | ||
3689 | register: VolatileCell<u32>, | ||
3690 | } | ||
3691 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3692 | pub mod tcd28_dlastsga; | ||
3693 | #[doc = "TCD Control and Status"] | ||
3694 | pub struct TCD28_CSR { | ||
3695 | register: VolatileCell<u16>, | ||
3696 | } | ||
3697 | #[doc = "TCD Control and Status"] | ||
3698 | pub mod tcd28_csr; | ||
3699 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3700 | pub struct TCD28_BITER_ELINKNO { | ||
3701 | register: VolatileCell<u16>, | ||
3702 | } | ||
3703 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3704 | pub mod tcd28_biter_elinkno; | ||
3705 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3706 | pub struct TCD28_BITER_ELINKYES { | ||
3707 | register: VolatileCell<u16>, | ||
3708 | } | ||
3709 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3710 | pub mod tcd28_biter_elinkyes; | ||
3711 | #[doc = "TCD Source Address"] | ||
3712 | pub struct TCD29_SADDR { | ||
3713 | register: VolatileCell<u32>, | ||
3714 | } | ||
3715 | #[doc = "TCD Source Address"] | ||
3716 | pub mod tcd29_saddr; | ||
3717 | #[doc = "TCD Signed Source Address Offset"] | ||
3718 | pub struct TCD29_SOFF { | ||
3719 | register: VolatileCell<u16>, | ||
3720 | } | ||
3721 | #[doc = "TCD Signed Source Address Offset"] | ||
3722 | pub mod tcd29_soff; | ||
3723 | #[doc = "TCD Transfer Attributes"] | ||
3724 | pub struct TCD29_ATTR { | ||
3725 | register: VolatileCell<u16>, | ||
3726 | } | ||
3727 | #[doc = "TCD Transfer Attributes"] | ||
3728 | pub mod tcd29_attr; | ||
3729 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3730 | pub struct TCD29_NBYTES_MLNO { | ||
3731 | register: VolatileCell<u32>, | ||
3732 | } | ||
3733 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3734 | pub mod tcd29_nbytes_mlno; | ||
3735 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3736 | pub struct TCD29_NBYTES_MLOFFNO { | ||
3737 | register: VolatileCell<u32>, | ||
3738 | } | ||
3739 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3740 | pub mod tcd29_nbytes_mloffno; | ||
3741 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3742 | pub struct TCD29_NBYTES_MLOFFYES { | ||
3743 | register: VolatileCell<u32>, | ||
3744 | } | ||
3745 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3746 | pub mod tcd29_nbytes_mloffyes; | ||
3747 | #[doc = "TCD Last Source Address Adjustment"] | ||
3748 | pub struct TCD29_SLAST { | ||
3749 | register: VolatileCell<u32>, | ||
3750 | } | ||
3751 | #[doc = "TCD Last Source Address Adjustment"] | ||
3752 | pub mod tcd29_slast; | ||
3753 | #[doc = "TCD Destination Address"] | ||
3754 | pub struct TCD29_DADDR { | ||
3755 | register: VolatileCell<u32>, | ||
3756 | } | ||
3757 | #[doc = "TCD Destination Address"] | ||
3758 | pub mod tcd29_daddr; | ||
3759 | #[doc = "TCD Signed Destination Address Offset"] | ||
3760 | pub struct TCD29_DOFF { | ||
3761 | register: VolatileCell<u16>, | ||
3762 | } | ||
3763 | #[doc = "TCD Signed Destination Address Offset"] | ||
3764 | pub mod tcd29_doff; | ||
3765 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3766 | pub struct TCD29_CITER_ELINKNO { | ||
3767 | register: VolatileCell<u16>, | ||
3768 | } | ||
3769 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3770 | pub mod tcd29_citer_elinkno; | ||
3771 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3772 | pub struct TCD29_CITER_ELINKYES { | ||
3773 | register: VolatileCell<u16>, | ||
3774 | } | ||
3775 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3776 | pub mod tcd29_citer_elinkyes; | ||
3777 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3778 | pub struct TCD29_DLASTSGA { | ||
3779 | register: VolatileCell<u32>, | ||
3780 | } | ||
3781 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3782 | pub mod tcd29_dlastsga; | ||
3783 | #[doc = "TCD Control and Status"] | ||
3784 | pub struct TCD29_CSR { | ||
3785 | register: VolatileCell<u16>, | ||
3786 | } | ||
3787 | #[doc = "TCD Control and Status"] | ||
3788 | pub mod tcd29_csr; | ||
3789 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3790 | pub struct TCD29_BITER_ELINKNO { | ||
3791 | register: VolatileCell<u16>, | ||
3792 | } | ||
3793 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3794 | pub mod tcd29_biter_elinkno; | ||
3795 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3796 | pub struct TCD29_BITER_ELINKYES { | ||
3797 | register: VolatileCell<u16>, | ||
3798 | } | ||
3799 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3800 | pub mod tcd29_biter_elinkyes; | ||
3801 | #[doc = "TCD Source Address"] | ||
3802 | pub struct TCD30_SADDR { | ||
3803 | register: VolatileCell<u32>, | ||
3804 | } | ||
3805 | #[doc = "TCD Source Address"] | ||
3806 | pub mod tcd30_saddr; | ||
3807 | #[doc = "TCD Signed Source Address Offset"] | ||
3808 | pub struct TCD30_SOFF { | ||
3809 | register: VolatileCell<u16>, | ||
3810 | } | ||
3811 | #[doc = "TCD Signed Source Address Offset"] | ||
3812 | pub mod tcd30_soff; | ||
3813 | #[doc = "TCD Transfer Attributes"] | ||
3814 | pub struct TCD30_ATTR { | ||
3815 | register: VolatileCell<u16>, | ||
3816 | } | ||
3817 | #[doc = "TCD Transfer Attributes"] | ||
3818 | pub mod tcd30_attr; | ||
3819 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3820 | pub struct TCD30_NBYTES_MLNO { | ||
3821 | register: VolatileCell<u32>, | ||
3822 | } | ||
3823 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3824 | pub mod tcd30_nbytes_mlno; | ||
3825 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3826 | pub struct TCD30_NBYTES_MLOFFNO { | ||
3827 | register: VolatileCell<u32>, | ||
3828 | } | ||
3829 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3830 | pub mod tcd30_nbytes_mloffno; | ||
3831 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3832 | pub struct TCD30_NBYTES_MLOFFYES { | ||
3833 | register: VolatileCell<u32>, | ||
3834 | } | ||
3835 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3836 | pub mod tcd30_nbytes_mloffyes; | ||
3837 | #[doc = "TCD Last Source Address Adjustment"] | ||
3838 | pub struct TCD30_SLAST { | ||
3839 | register: VolatileCell<u32>, | ||
3840 | } | ||
3841 | #[doc = "TCD Last Source Address Adjustment"] | ||
3842 | pub mod tcd30_slast; | ||
3843 | #[doc = "TCD Destination Address"] | ||
3844 | pub struct TCD30_DADDR { | ||
3845 | register: VolatileCellz<u32>, | ||
3846 | } | ||
3847 | #[doc = "TCD Destination Address"] | ||
3848 | pub mod tcd30_daddr; | ||
3849 | #[doc = "TCD Signed Destination Address Offset"] | ||
3850 | pub struct TCD30_DOFF { | ||
3851 | register: VolatileCell<u16>, | ||
3852 | } | ||
3853 | #[doc = "TCD Signed Destination Address Offset"] | ||
3854 | pub mod tcd30_doff; | ||
3855 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3856 | pub struct TCD30_CITER_ELINKNO { | ||
3857 | register: VolatileCell<u16>, | ||
3858 | } | ||
3859 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3860 | pub mod tcd30_citer_elinkno; | ||
3861 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3862 | pub struct TCD30_CITER_ELINKYES { | ||
3863 | register: VolatileCell<u16>, | ||
3864 | } | ||
3865 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3866 | pub mod tcd30_citer_elinkyes; | ||
3867 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3868 | pub struct TCD30_DLASTSGA { | ||
3869 | register: VolatileCell<u32>, | ||
3870 | } | ||
3871 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3872 | pub mod tcd30_dlastsga; | ||
3873 | #[doc = "TCD Control and Status"] | ||
3874 | pub struct TCD30_CSR { | ||
3875 | register: VolatileCell<u16>, | ||
3876 | } | ||
3877 | #[doc = "TCD Control and Status"] | ||
3878 | pub mod tcd30_csr; | ||
3879 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3880 | pub struct TCD30_BITER_ELINKNO { | ||
3881 | register: VolatileCell<u16>, | ||
3882 | } | ||
3883 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3884 | pub mod tcd30_biter_elinkno; | ||
3885 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3886 | pub struct TCD30_BITER_ELINKYES { | ||
3887 | register: VolatileCell<u16>, | ||
3888 | } | ||
3889 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3890 | pub mod tcd30_biter_elinkyes; | ||
3891 | #[doc = "TCD Source Address"] | ||
3892 | pub struct TCD31_SADDR { | ||
3893 | register: VolatileCell<u32>, | ||
3894 | } | ||
3895 | #[doc = "TCD Source Address"] | ||
3896 | pub mod tcd31_saddr; | ||
3897 | #[doc = "TCD Signed Source Address Offset"] | ||
3898 | pub struct TCD31_SOFF { | ||
3899 | register: VolatileCell<u16>, | ||
3900 | } | ||
3901 | #[doc = "TCD Signed Source Address Offset"] | ||
3902 | pub mod tcd31_soff; | ||
3903 | #[doc = "TCD Transfer Attributes"] | ||
3904 | pub struct TCD31_ATTR { | ||
3905 | register: VolatileCell<u16>, | ||
3906 | } | ||
3907 | #[doc = "TCD Transfer Attributes"] | ||
3908 | pub mod tcd31_attr; | ||
3909 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3910 | pub struct TCD31_NBYTES_MLNO { | ||
3911 | register: VolatileCell<u32>, | ||
3912 | } | ||
3913 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3914 | pub mod tcd31_nbytes_mlno; | ||
3915 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3916 | pub struct TCD31_NBYTES_MLOFFNO { | ||
3917 | register: VolatileCell<u32>, | ||
3918 | } | ||
3919 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3920 | pub mod tcd31_nbytes_mloffno; | ||
3921 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3922 | pub struct TCD31_NBYTES_MLOFFYES { | ||
3923 | register: VolatileCell<u32>, | ||
3924 | } | ||
3925 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3926 | pub mod tcd31_nbytes_mloffyes; | ||
3927 | #[doc = "TCD Last Source Address Adjustment"] | ||
3928 | pub struct TCD31_SLAST { | ||
3929 | register: VolatileCell<u32>, | ||
3930 | } | ||
3931 | #[doc = "TCD Last Source Address Adjustment"] | ||
3932 | pub mod tcd31_slast; | ||
3933 | #[doc = "TCD Destination Address"] | ||
3934 | pub struct TCD31_DADDR { | ||
3935 | register: VolatileCell<u32>, | ||
3936 | } | ||
3937 | #[doc = "TCD Destination Address"] | ||
3938 | pub mod tcd31_daddr; | ||
3939 | #[doc = "TCD Signed Destination Address Offset"] | ||
3940 | pub struct TCD31_DOFF { | ||
3941 | register: VolatileCell<u16>, | ||
3942 | } | ||
3943 | #[doc = "TCD Signed Destination Address Offset"] | ||
3944 | pub mod tcd31_doff; | ||
3945 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3946 | pub struct TCD31_CITER_ELINKNO { | ||
3947 | register: VolatileCell<u16>, | ||
3948 | } | ||
3949 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3950 | pub mod tcd31_citer_elinkno; | ||
3951 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3952 | pub struct TCD31_CITER_ELINKYES { | ||
3953 | register: VolatileCell<u16>, | ||
3954 | } | ||
3955 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3956 | pub mod tcd31_citer_elinkyes; | ||
3957 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3958 | pub struct TCD31_DLASTSGA { | ||
3959 | register: VolatileCell<u32>, | ||
3960 | } | ||
3961 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3962 | pub mod tcd31_dlastsga; | ||
3963 | #[doc = "TCD Control and Status"] | ||
3964 | pub struct TCD31_CSR { | ||
3965 | register: VolatileCell<u32>, | ||
3966 | } | ||
3967 | #[doc = "TCD Control and Status"] | ||
3968 | pub mod tcd31_csr; | ||
3969 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3970 | pub struct TCD31_BITER_ELINKNO { | ||
3971 | register: VolatileCell<u16>, | ||
3972 | } | ||
3973 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3974 | pub mod tcd31_biter_elinkno; | ||
3975 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3976 | pub struct TCD31_BITER_ELINKYES { | ||
3977 | register: VolatileCell<u16>, | ||
3978 | } | ||
3979 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3980 | pub mod tcd31_biter_elinkyes; | ||
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 06341f003..2a65000b8 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml | |||
@@ -17,3 +17,4 @@ serde_json = "1.0.48" | |||
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
18 | 18 | ||
19 | stdx = { path = "../stdx", version = "0.0.0" } | 19 | stdx = { path = "../stdx", version = "0.0.0" } |
20 | profile = { path = "../profile", version = "0.0.0" } | ||
diff --git a/crates/test_utils/src/bench_fixture.rs b/crates/test_utils/src/bench_fixture.rs new file mode 100644 index 000000000..aa1bea9bb --- /dev/null +++ b/crates/test_utils/src/bench_fixture.rs | |||
@@ -0,0 +1,37 @@ | |||
1 | //! Generates large snippets of Rust code for usage in the benchmarks. | ||
2 | |||
3 | use std::fs; | ||
4 | |||
5 | use stdx::format_to; | ||
6 | |||
7 | use crate::project_dir; | ||
8 | |||
9 | pub fn big_struct() -> String { | ||
10 | let n = 1_000; | ||
11 | |||
12 | let mut buf = "pub struct RegisterBlock {".to_string(); | ||
13 | for i in 0..n { | ||
14 | format_to!(buf, " /// Doc comment for {}.\n", i); | ||
15 | format_to!(buf, " pub s{}: S{},\n", i, i); | ||
16 | } | ||
17 | buf.push_str("}\n\n"); | ||
18 | for i in 0..n { | ||
19 | format_to!( | ||
20 | buf, | ||
21 | " | ||
22 | |||
23 | #[repr(transparent)] | ||
24 | struct S{} {{ | ||
25 | field: u32, | ||
26 | }}", | ||
27 | i | ||
28 | ); | ||
29 | } | ||
30 | |||
31 | buf | ||
32 | } | ||
33 | |||
34 | pub fn glorious_old_parser() -> String { | ||
35 | let path = project_dir().join("bench_data/glorious_old_parser"); | ||
36 | fs::read_to_string(&path).unwrap() | ||
37 | } | ||
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index e19d2ad61..5be4a64fc 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #[macro_use] | 9 | #[macro_use] |
10 | pub mod mark; | 10 | pub mod mark; |
11 | pub mod bench_fixture; | ||
11 | mod fixture; | 12 | mod fixture; |
12 | 13 | ||
13 | use std::{ | 14 | use std::{ |
@@ -16,6 +17,7 @@ use std::{ | |||
16 | path::PathBuf, | 17 | path::PathBuf, |
17 | }; | 18 | }; |
18 | 19 | ||
20 | use profile::StopWatch; | ||
19 | use serde_json::Value; | 21 | use serde_json::Value; |
20 | use stdx::lines_with_ends; | 22 | use stdx::lines_with_ends; |
21 | use text_size::{TextRange, TextSize}; | 23 | use text_size::{TextRange, TextSize}; |
@@ -406,3 +408,44 @@ pub fn format_diff(chunks: Vec<dissimilar::Chunk>) -> String { | |||
406 | } | 408 | } |
407 | buf | 409 | buf |
408 | } | 410 | } |
411 | |||
412 | /// Utility for writing benchmark tests. | ||
413 | /// | ||
414 | /// A benchmark test looks like this: | ||
415 | /// | ||
416 | /// ``` | ||
417 | /// #[test] | ||
418 | /// fn benchmark_foo() { | ||
419 | /// if skip_slow_tests() { return; } | ||
420 | /// | ||
421 | /// let data = bench_fixture::some_fixture(); | ||
422 | /// let analysis = some_setup(); | ||
423 | /// | ||
424 | /// let hash = { | ||
425 | /// let _b = bench("foo"); | ||
426 | /// actual_work(analysis) | ||
427 | /// }; | ||
428 | /// assert_eq!(hash, 92); | ||
429 | /// } | ||
430 | /// ``` | ||
431 | /// | ||
432 | /// * We skip benchmarks by default, to save time. | ||
433 | /// Ideal benchmark time is 800 -- 1500 ms in debug. | ||
434 | /// * We don't count preparation as part of the benchmark | ||
435 | /// * The benchmark itself returns some kind of numeric hash. | ||
436 | /// The hash is used as a sanity check that some code is actually run. | ||
437 | /// Otherwise, it's too easy to win the benchmark by just doing nothing. | ||
438 | pub fn bench(label: &'static str) -> impl Drop { | ||
439 | struct Bencher { | ||
440 | sw: StopWatch, | ||
441 | label: &'static str, | ||
442 | } | ||
443 | |||
444 | impl Drop for Bencher { | ||
445 | fn drop(&mut self) { | ||
446 | eprintln!("{}: {}", self.label, self.sw.elapsed()) | ||
447 | } | ||
448 | } | ||
449 | |||
450 | Bencher { sw: StopWatch::start(), label } | ||
451 | } | ||