Skip to content

Commit 128fc7a

Browse files
authored
Merge pull request #251 from cosmikwolf/expand_cluster
Expand cluster implementation + fix _strip to work on clusters
2 parents 2026a27 + 1d9454a commit 128fc7a

File tree

6 files changed

+2268
-8
lines changed

6 files changed

+2268
-8
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,29 @@ _rebase:
266266
FIRST_REG: {}
267267
SECOND_REG: {}
268268

269+
# clusters can be expanded into individual registers. The name of the resulting register will be the cluster name, concatenated with the register name.
270+
271+
_expand_cluster:
272+
- CLUSTER_ONE*
273+
- CLUSTER_TWO*
274+
275+
# When expanding clusters containing more than one element (as specified by <dim>), each register will have substutute [%] in the cluster name with its index number. If the cluster has a dimIndex element, a %s in the cluster name will be replaced by dimIndex element. [%] is not compatible with dimIndex, as according to SVD 1.3.10
276+
# The SVD 1.3.10 does not specify a delimiter for expansion, so passing the following parameters to the cluster as a hash will allow you to set the delimiter before and after the index is applied (the default delimiters are "_". You can also force the cluster to apply a zero index to a cluster with a single element by passing in the _zeroindex: true parameter
277+
278+
_expand_cluster:
279+
CLUSTER_ONE*:
280+
CLUSTER_TWO*:
281+
_preindex: "_"
282+
_postindex: "_"
283+
_zeroindex: true
284+
285+
286+
# if you pass the _noprefix: true parameter to a cluster, the cluster name will not be prefixed with the peripheral name. This is only valid for single element clusters.
287+
288+
_expand_cluster:
289+
CLUSTER_ONE*:
290+
_noprefix: true
291+
269292
# A register on this peripheral, matches an SVD <register> tag
270293
MODER:
271294
# As in the peripheral scope, rename or redescribe a field.

0 commit comments

Comments
 (0)