From ef06c93772119e82370598ef57200a5882c25bba Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Sat, 16 Jan 2021 16:34:12 +0100 Subject: [PATCH 1/5] [dfg] Print Parsing did first for STM32 --- tools/generator/dfg/stm32/stm_device_tree.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/generator/dfg/stm32/stm_device_tree.py b/tools/generator/dfg/stm32/stm_device_tree.py index 379b28c2..77ac3829 100644 --- a/tools/generator/dfg/stm32/stm_device_tree.py +++ b/tools/generator/dfg/stm32/stm_device_tree.py @@ -57,16 +57,14 @@ def getDevicesFromPrefix(prefix): @staticmethod def _properties_from_partname(partname): - p = {} + did = STMIdentifier.from_string(partname.lower()) + LOGGER.info("Parsing '{}'".format(did.string)) + p = {"id": did} deviceNames = STMDeviceTree.familyFile.query('//Family/SubFamily/Mcu[starts-with(@RefName,"{}")]' .format(partname[:12] + "x" + partname[13:])) comboDeviceName = sorted([d.get("Name") for d in deviceNames])[0] device_file = XMLReader(os.path.join(STMDeviceTree.rootpath, comboDeviceName + ".xml")) - did = STMIdentifier.from_string(partname.lower()) - p["id"] = did - - LOGGER.info("Parsing '{}'".format(did.string)) # information about the core and architecture core = device_file.query('//Core')[0].text.lower().replace("arm ", "") From 94c94a04414a757a7273aa5a53365307e4f44243 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Fri, 1 May 2020 17:27:02 +0200 Subject: [PATCH 2/5] [device] Make data access read-only to avoid copy --- modm_devices/access.py | 55 +++++++++++++++++++++++++++++++++++++ modm_devices/device.py | 21 +++++--------- modm_devices/device_file.py | 24 ++++++++-------- 3 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 modm_devices/access.py diff --git a/modm_devices/access.py b/modm_devices/access.py new file mode 100644 index 00000000..9cc99f4f --- /dev/null +++ b/modm_devices/access.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import copy + +def copy_keys(src, *keys): + dest = {}; + for key in keys: + conv = lambda o: o + if isinstance(key, tuple): + key, conv = key + if key in src: + dest[key] = conv(src[key]) + return dest + +def copy_deep(obj): + return copy.deepcopy(obj) + + +class ReadOnlyList(list): + def __readonly__(self, *args, **kwargs): + raise RuntimeError("You are trying to modify read-only DeviceFile data!") + pop = __readonly__ + remove = __readonly__ + append = __readonly__ + clear = __readonly__ + extend = __readonly__ + insert = __readonly__ + reverse = __readonly__ + __copy__ = list.copy + __deepcopy__ = copy._deepcopy_dispatch.get(list) + del __readonly__ + + +class ReadOnlyDict(dict): + def __readonly__(self, *args, **kwargs): + raise RuntimeError("You are trying to modify read-only DeviceFile data!") + __setitem__ = __readonly__ + __delitem__ = __readonly__ + pop = __readonly__ + popitem = __readonly__ + clear = __readonly__ + update = __readonly__ + setdefault = __readonly__ + __copy__ = dict.copy + __deepcopy__ = copy._deepcopy_dispatch.get(dict) + del __readonly__ + + +def read_only(obj): + if isinstance(obj, dict): + return ReadOnlyDict(obj) + if isinstance(obj, list): + return ReadOnlyList(obj) + return obj diff --git a/modm_devices/device.py b/modm_devices/device.py index a009bec3..845f69aa 100644 --- a/modm_devices/device.py +++ b/modm_devices/device.py @@ -21,26 +21,19 @@ def __init__(self, self.partname = identifier.string self.device_file = device_file - self._properties = None - - def __parse_properties(self): - """ - Perform a lazy initialization of the driver property tree. - """ - if self._properties is None: - self._properties = self.device_file.get_properties(self._identifier) + self.__properties = None @property - def properties(self): - self.__parse_properties() - return copy.deepcopy(self._properties) + def _properties(self): + if self.__properties is None: + self.__properties = self.device_file.get_properties(self._identifier) + return self.__properties @property def identifier(self): - return self._identifier.copy() + return self._identifier def get_all_drivers(self, name): - self.__parse_properties() parts = name.split(":") results = [] @@ -58,7 +51,7 @@ def get_all_drivers(self, name): "The name must contain no or one ':' to " "separate type and name.".format(name)) - return copy.deepcopy(results) + return results def get_driver(self, name): results = self.get_all_drivers(name) diff --git a/modm_devices/device_file.py b/modm_devices/device_file.py index 065a07be..b3f2eced 100644 --- a/modm_devices/device_file.py +++ b/modm_devices/device_file.py @@ -6,12 +6,14 @@ # All rights reserved. import lxml.etree +import copy from collections import defaultdict from .device import Device from .device_identifier import DeviceIdentifier from .device_identifier import MultiDeviceIdentifier +from .access import read_only from .exception import ParserException @@ -59,14 +61,13 @@ def is_valid(node, identifier: DeviceIdentifier): Returns: True if the selectors match, False otherwise. """ - device_keys = filter(lambda k: k.startswith(DeviceFile._PREFIX_ATTRIBUTE_DEVICE), node.attrib.keys()) - properties = {k.replace(DeviceFile._PREFIX_ATTRIBUTE_DEVICE, ''):node.attrib[k].split("|") for k in device_keys} - return not any(identifier[key] not in value for key, value in properties.items()) + device_keys = (k for k in node.attrib.keys() if k.startswith(DeviceFile._PREFIX_ATTRIBUTE_DEVICE)) + properties = ((k.replace(DeviceFile._PREFIX_ATTRIBUTE_DEVICE, ''), node.attrib[k].split("|")) + for k in device_keys) + return all(identifier[key] in value for key, value in properties) def get_properties(self, identifier: DeviceIdentifier): class Converter: - """ - """ def __init__(self, identifier: DeviceIdentifier): self.identifier = identifier @@ -79,9 +80,9 @@ def is_valid(self, node): return DeviceFile.is_valid(node, self.identifier) def strip_attrib(self, node): - stripped_keys = filter(lambda k: not k.startswith(DeviceFile._PREFIX_ATTRIBUTE_DEVICE), node.attrib.keys()) + stripped_keys = (k for k in node.attrib.keys() if not k.startswith(DeviceFile._PREFIX_ATTRIBUTE_DEVICE)) if node.getparent().getparent() is None and node.tag == 'device': - stripped_keys = filter(lambda k: k not in self.identifier.keys(), stripped_keys) + stripped_keys = (k for k in stripped_keys if k not in self.identifier.keys()) return {k:node.attrib[k] for k in stripped_keys} def to_dict(self, t): @@ -90,10 +91,7 @@ def to_dict(self, t): return {} attrib = self.strip_attrib(t) d = {t.tag: {} if len(attrib) else None} - children = [] - for c in t: - if self.is_valid(c): - children.append(c) + children = filter(self.is_valid, t) if children: dd = defaultdict(list) for dc in map(self.to_dict, children): @@ -106,7 +104,7 @@ def to_dict(self, t): raise ParserException("Attribute '{}' cannot be a list!".format(k)) k = k.replace(DeviceFile._PREFIX_ATTRIBUTE, '') v = v[0] - dk[k] = v + dk[k] = read_only(v) d = {t.tag: dk} if list(attrib.keys()) == ['value']: d[t.tag] = attrib['value'] @@ -114,7 +112,7 @@ def to_dict(self, t): if any(k in d[t.tag] for k in attrib.keys()): raise ParserException("Node children are overwriting attribute '{}'!".format(k)) d[t.tag].update(attrib.items()) - return d + return read_only({k:read_only(v) for k,v in d.items()}) properties = Converter(identifier).to_dict(self.rootnode.find("device")) return properties["device"] From d1664488eb32fcda35302539d9bba370c0a409ef Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Fri, 1 May 2020 02:15:28 +0200 Subject: [PATCH 3/5] [test] Add device file consistency test --- modm_devices/device_file.py | 5 + modm_devices/device_identifier.py | 25 +-- test/device_file_test.py | 84 ++++++++ test/device_identifier_test.py | 303 +++++++++++++++++++++++++++++ tools/generator/dfg/device_tree.py | 9 +- 5 files changed, 412 insertions(+), 14 deletions(-) create mode 100644 test/device_file_test.py create mode 100644 test/device_identifier_test.py diff --git a/modm_devices/device_file.py b/modm_devices/device_file.py index b3f2eced..68e8c9aa 100644 --- a/modm_devices/device_file.py +++ b/modm_devices/device_file.py @@ -95,7 +95,9 @@ def to_dict(self, t): if children: dd = defaultdict(list) for dc in map(self.to_dict, children): + # print(dc) for k, v in dc.items(): + # if k == "signal" and v.get("name") == "seg40": print(v) dd[k].append(v) dk = {} for k, v in dd.items(): @@ -111,8 +113,11 @@ def to_dict(self, t): elif len(attrib): if any(k in d[t.tag] for k in attrib.keys()): raise ParserException("Node children are overwriting attribute '{}'!".format(k)) + # print(attrib.items()) d[t.tag].update(attrib.items()) return read_only({k:read_only(v) for k,v in d.items()}) properties = Converter(identifier).to_dict(self.rootnode.find("device")) + # print(properties) + # exit(1) return properties["device"] diff --git a/modm_devices/device_identifier.py b/modm_devices/device_identifier.py index cc13a49b..3bb24954 100644 --- a/modm_devices/device_identifier.py +++ b/modm_devices/device_identifier.py @@ -99,12 +99,14 @@ def __init__(self, objs=None): if isinstance(objs, DeviceIdentifier): self._ids = [objs.copy()] - if isinstance(objs, (list, set, tuple)): + elif isinstance(objs, (list, set, tuple)): for obj in objs: - if isinstance(objs, DeviceIdentifier): - self._ids.append(objs) - if isinstance(objs, MultiDeviceIdentifier): + if isinstance(obj, DeviceIdentifier): + self._ids.append(obj) + elif isinstance(objs, MultiDeviceIdentifier): self._ids = [dev for dev in objs.ids] + elif objs is not None: + print("No known conversion of '{}' to MultiDeviceIdentifier!".format(objs)) @property def ids(self): @@ -126,13 +128,14 @@ def from_list(device_ids: list): mid._ids = [dev for dev in device_ids] return mid - def append(self, did): - assert isinstance(did, DeviceIdentifier) + def append(self, *dids): + for did in dids: + assert isinstance(did, DeviceIdentifier) - self._ids.append(did) - self.__dirty = True - self.__string = None - self.__naming_schema = None + self._ids.append(did) + self.__dirty = True + self.__string = None + self.__naming_schema = None def extend(self, dids): assert isinstance(dids, (MultiDeviceIdentifier, list)) @@ -344,4 +347,4 @@ def __str__(self): return self.string def __repr__(self): - return self.string \ No newline at end of file + return self.string diff --git a/test/device_file_test.py b/test/device_file_test.py new file mode 100644 index 00000000..c98c812f --- /dev/null +++ b/test/device_file_test.py @@ -0,0 +1,84 @@ + +import unittest +import glob +import os + +import modm_devices.parser + +DEVICE_FILES = None + +class DeviceFileTest(unittest.TestCase): + + def setUp(self): + global DEVICE_FILES + if DEVICE_FILES is None: + DEVICE_FILES = {} + device_files = os.path.join(os.path.dirname(__file__), "../devices/**/*.xml") + # device_files = os.path.join(os.path.dirname(__file__), "../devices/stm32/stm32l1-51_52_62-c_d_e.xml") + device_file_names = glob.glob(device_files) + + # Parse the files and build the :target enumeration + parser = modm_devices.parser.DeviceParser() + for device_file_name in device_file_names: + for device in parser.parse(device_file_name).get_devices(): + DEVICE_FILES[device.partname] = device + + # self.devices = {"stm32l152vdt6": DEVICE_FILES["stm32l152vdt6"]} + self.devices = DEVICE_FILES + + + def tearDown(self): + self.devices = None + + def get_drivers(self, device): + drivers = [] + for d in device._properties["driver"]: + if "instance" in d: + drivers.extend( (d["name"], i["name"]) for i in d["instance"] ) + else: + drivers.append( (d["name"],) ) + return drivers + + def test_drivers(self): + failures = 0 + for name, device in self.devices.items(): + def assertIn(key, obj): + if key not in obj: + print('{}: Missing "{}" key in "{}"!'.format(name, key, obj)) + nonlocal failures + failures += 1 + return False + return True + drivers = self.get_drivers(device) + gpios = device.get_driver("gpio") + assertIn("gpio", gpios) + for gpio in gpios.get("gpio", []): + signals = [] + for signal in gpio.get("signal", []): + # Check for name and driver keys in each signal + assertIn("name", signal) + if assertIn("driver", signal): + # Check if the signal driver is known + if "instance" in signal: + driver = (signal["driver"], signal["instance"]) + else: + driver = (signal["driver"],) + signals.append( (*driver, signal["name"]) ) + # assertIn(driver, drivers) + + # Check for duplicate signals + if not len(signals) == len(set(signals)): + duplicates = set(x for x in signals if signals.count(x) > 1) + print("{}: duplicated signals for P{}{}: {}".format( + name, gpio["port"].upper(), gpio["pin"], duplicates)) + failures += 1 + # print(gpio) + + # self.assertEqual(failures, 0, "Found inconsistencies in the device files!") + + + + + + + diff --git a/test/device_identifier_test.py b/test/device_identifier_test.py new file mode 100644 index 00000000..e896f535 --- /dev/null +++ b/test/device_identifier_test.py @@ -0,0 +1,303 @@ + +import unittest + +from modm_devices.exception import DeviceIdentifierException +from modm_devices.device_identifier import DeviceIdentifier, MultiDeviceIdentifier + +class DeviceIdentifierTest(unittest.TestCase): + + def test_should_construct_empty(self): + ident = DeviceIdentifier() + self.assertEqual(repr(ident), "DeviceId()") + self.assertEqual(len(ident.keys()), 0) + self.assertRaises(DeviceIdentifierException, + lambda: ident.string) + self.assertRaises(DeviceIdentifierException, + lambda: str(ident)) + self.assertRaises(AttributeError, + lambda: ident.whatevs) + + + def test_setter_getter(self): + ident = DeviceIdentifier() + ident.set("platform", "stm32") + self.assertEqual(ident.get("platform"), "stm32") + self.assertEqual(ident["platform"], "stm32") + self.assertEqual(ident.platform, "stm32") + self.assertEqual(repr(ident), "DeviceId(platformstm32)") + self.assertRaises(DeviceIdentifierException, + lambda: ident.string) + self.assertRaises(DeviceIdentifierException, + lambda: str(ident)) + + ident.set("platform", "avr") + self.assertEqual(ident.get("platform"), "avr") + self.assertEqual(ident["platform"], "avr") + self.assertEqual(ident.platform, "avr") + + self.assertEqual(ident.get("whatevs"), None) + self.assertEqual(ident.get("whatevs", "default"), "default") + self.assertEqual(ident["whatevs"], None) + self.assertRaises(AttributeError, + lambda: ident.whatevs) + + + def test_naming_schema(self): + ident = DeviceIdentifier("{platform}{family}{name}") + self.assertEqual(ident.string, "") + ident.set("platform", "stm32") + self.assertEqual(ident.string, "stm32") + ident.set("name", "03") + self.assertEqual(ident.string, "stm3203") + ident.set("family", "f1") + self.assertEqual(ident.string, "stm32f103") + + self.assertEqual(str(ident), "stm32f103") + self.assertEqual(repr(ident), "stm32f103") + self.assertEqual(hash(ident), hash("familyf1name03platformstm32{platform}{family}{name}")) + + ident2 = DeviceIdentifier("{platform}{family}{name}") + ident2.set("platform", "stm32") + ident2.set("family", "f1") + ident2.set("name", "03") + self.assertEqual(hash(ident2), hash("familyf1name03platformstm32{platform}{family}{name}")) + + self.assertTrue(ident == ident2) + self.assertFalse(ident != ident2) + self.assertEqual(ident, ident2) + + ident3 = DeviceIdentifier("{platform}{family}") + ident3.set("platform", "stm32") + ident3.set("family", "f1") + self.assertEqual(hash(ident3), hash("familyf1platformstm32{platform}{family}")) + + self.assertTrue(ident != ident3) + self.assertFalse(ident == ident3) + self.assertNotEqual(ident, ident3) + + + def test_copy(self): + ident = DeviceIdentifier("{platform}") + ident.set("platform", "stm32") + + ident2 = ident.copy() + self.assertEqual(ident2.platform, "stm32") + self.assertEqual(ident2.naming_schema, "{platform}") + ident2.set("platform", "avr") + self.assertEqual(ident2.platform, "avr") + self.assertEqual(ident.platform, "stm32") + ident2.naming_schema = "{platform}{family}" + self.assertEqual(ident2.naming_schema, "{platform}{family}") + self.assertEqual(ident.naming_schema, "{platform}") + + +def id_from_string(string): + i = DeviceIdentifier("{platform}{family}{name}{pin}{size}{package}{temperature}{variant}") + i.set("platform", string[:5]) + i.set("family", string[5:7]) + i.set("name", string[7:9]) + i.set("pin", string[9]) + i.set("size", string[10]) + i.set("package", string[11]) + i.set("temperature", string[12]) + if len(string) >= 14: + i.set("variant", string[13]) + else: + i.set("variant", "") + return i + + +class MultiDeviceIdentifierTest(unittest.TestCase): + + def setUp(self): + self.ident = MultiDeviceIdentifier() + self.devices = MultiDeviceIdentifier(list(map(id_from_string, [ + "stm32l151cct6", + "stm32l151cct7", + "stm32l151ccu6", + "stm32l151ccu7", + "stm32l151qch6", + "stm32l151qdh6", + "stm32l151qeh6", + "stm32l151rct6", + "stm32l151rct6a", + "stm32l151rcy6", + "stm32l151rdt6", + "stm32l151rdt7", + "stm32l151rdy6", + "stm32l151rdy7", + "stm32l151ret6", + "stm32l151ucy6", + "stm32l151ucy7", + "stm32l151vch6", + "stm32l151vct6", + "stm32l151vct6a", + "stm32l151vdt6", + "stm32l151vdt6x", + "stm32l151vdy6x", + "stm32l151vdy7x", + "stm32l151vet6", + "stm32l151vet7", + "stm32l151vey6", + "stm32l151vey7", + "stm32l151zct6", + "stm32l151zdt6", + "stm32l151zet6", + "stm32l152cct6", + "stm32l152ccu6", + "stm32l152qch6", + "stm32l152qdh6", + "stm32l152qeh6", + "stm32l152rct6", + "stm32l152rct6a", + "stm32l152rdt6", + "stm32l152rdy6", + "stm32l152ret6", + "stm32l152ucy6", + "stm32l152vch6", + "stm32l152vct6", + "stm32l152vct6a", + "stm32l152vdt6", + "stm32l152vdt6x", + "stm32l152vet6", + "stm32l152vey6", + "stm32l152zct6", + "stm32l152zdt6", + "stm32l152zet6", + "stm32l162qdh6", + "stm32l162rct6", + "stm32l162rct6a", + "stm32l162rdt6", + "stm32l162rdy6", + "stm32l162ret6", + "stm32l162vch6", + "stm32l162vct6", + "stm32l162vct6a", + "stm32l162vdt6", + "stm32l162vdy6x", + "stm32l162vet6", + "stm32l162vey6", + "stm32l162zdt6", + "stm32l162zet6" + ]))) + self.child_devices = MultiDeviceIdentifier(list(map(id_from_string, [ + "stm32l152qch6", + "stm32l152qdh6", + "stm32l152qeh6", + "stm32l152vch6", + "stm32l152rct6a", + "stm32l152rdt6", + "stm32l152ret6", + "stm32l152vct6a", + "stm32l152vct6", + "stm32l152vdt6x", + "stm32l152vdt6", + "stm32l152vet6", + "stm32l152zct6", + "stm32l152zdt6", + "stm32l152zet6", + "stm32l152rdy6", + "stm32l152vey6", + "stm32l162qdh6", + "stm32l162vch6", + "stm32l162rct6a", + "stm32l162rdt6", + "stm32l162ret6", + "stm32l162vct6a", + "stm32l162vct6", + "stm32l162vdt6", + "stm32l162vet6", + "stm32l162zdt6", + "stm32l162zet6", + "stm32l162rdy6", + "stm32l162vdy6x", + "stm32l162vey6", + ]))) + self.parent_devices = MultiDeviceIdentifier(list(map(id_from_string, [ + "stm32l151qch6", + "stm32l151qdh6", + "stm32l151qeh6", + "stm32l151vch6", + "stm32l151rct6a", + "stm32l151rct6", + "stm32l151rdt6", + "stm32l151rdt7", + "stm32l151ret6", + "stm32l151vct6a", + "stm32l151vct6", + "stm32l151vdt6x", + "stm32l151vdt6", + "stm32l151vet6", + "stm32l151vet7", + "stm32l151zct6", + "stm32l151zdt6", + "stm32l151zet6", + "stm32l151rcy6", + "stm32l151rdy6", + "stm32l151rdy7", + "stm32l151ucy6", + "stm32l151ucy7", + "stm32l151vdy6x", + "stm32l151vdy7x", + "stm32l151vey6", + "stm32l151vey7", + "stm32l152qch6", + "stm32l152qdh6", + "stm32l152qeh6", + "stm32l152vch6", + "stm32l152rct6a", + "stm32l152rct6", + "stm32l152rdt6", + "stm32l152ret6", + "stm32l152vct6a", + "stm32l152vct6", + "stm32l152vdt6x", + "stm32l152vdt6", + "stm32l152vet6", + "stm32l152zct6", + "stm32l152zdt6", + "stm32l152zet6", + "stm32l152rdy6", + "stm32l152ucy6", + "stm32l152vey6", + "stm32l162qdh6", + "stm32l162vch6", + "stm32l162rct6a", + "stm32l162rct6", + "stm32l162rdt6", + "stm32l162ret6", + "stm32l162vct6a", + "stm32l162vct6", + "stm32l162vdt6", + "stm32l162vet6", + "stm32l162zdt6", + "stm32l162zet6", + "stm32l162rdy6", + "stm32l162vdy6x", + "stm32l162vey6", + ]))) + + def test_should_construct_empty(self): + self.assertEqual(self.ident.string, "") + self.assertEqual(self.ident.naming_schema, "") + + def test_should_merge_naming_schemas(self): + + self.ident.append(DeviceIdentifier("{one}")) + self.assertEqual(self.ident.naming_schema, "{one}") + + self.ident.append(DeviceIdentifier("{one}")) + self.assertEqual(self.ident.naming_schema, "{one}") + + self.ident.append(DeviceIdentifier("{one}{two}")) + self.assertEqual(self.ident.naming_schema, "{one}{one}{two}") + + # def test_minimal_subtract_set(self): + # print(self.devices) + # print(self.parent_devices) + # print(self.child_devices) + + # min_set = self.child_devices.minimal_subtract_set(self.devices, self.parent_devices) + # for m in min_set: + # print([(k, m.getAttribute(k)) for k in self.devices.keys() if m.getAttribute(k)]) + # self.assertEqual(min_set, "[f1]") diff --git a/tools/generator/dfg/device_tree.py b/tools/generator/dfg/device_tree.py index 0ac3c490..c94f96df 100644 --- a/tools/generator/dfg/device_tree.py +++ b/tools/generator/dfg/device_tree.py @@ -119,20 +119,23 @@ def _sortTree(self): for ch in self.children: ch._sortTree() - def toString(self, indent=0): + def toString(self, indent=0, long_ids=False): ind = ' ' * indent if indent >= 2: ind = ind[:-2] + '. ' if self.parent is None or self.parent.ids == self.ids: ident = "" else: - ident = self.ids.string + if long_ids: + ident = " ".join(did.string for did in self.ids) + else: + ident = self.ids.string string = "{}{} {}\n".format( ind, self._toCompactString(), ident) for ch in self.children: - string += ch.toString(indent + 2) + string += ch.toString(indent + 2, long_ids) return string def _toCompactString(self): From 068b715bb31a793f8f257d61b43f8372f308cbbb Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Fri, 19 Feb 2021 21:34:56 +0100 Subject: [PATCH 4/5] [dfg] Query features from memory map --- devices/avr/at90-32_64_128-can.xml | 12 +- devices/avr/atmega-1281_2561.xml | 16 +- devices/avr/atmega-1284-n_p.xml | 12 +- .../avr/atmega-164_324_644-a_n_p_pa_pv_v.xml | 10 +- devices/avr/atmega-169_329_649.xml | 8 +- devices/avr/atmega-16_32-u4_u4rc.xml | 10 +- devices/avr/atmega-16_32_64-c1_m1.xml | 4 +- devices/avr/atmega-324-pb.xml | 24 +-- .../atmega-48_88_168_328-a_n_p_pa_pv_v.xml | 8 +- devices/avr/atmega-48_88_168_328-pb.xml | 22 +-- devices/avr/atmega-640_1280_2560.xml | 20 +- devices/avr/atmega-64_128-a_l_n.xml | 12 +- devices/avr/atmega-8_16_32-a_l_n.xml | 6 +- devices/avr/atmega-8_16_32-u2.xml | 6 +- devices/avr/attiny-102_104.xml | 2 +- devices/avr/attiny-13.xml | 2 +- devices/avr/attiny-20.xml | 4 +- devices/avr/attiny-24_44_84.xml | 4 +- devices/avr/attiny-25_45_85.xml | 6 +- devices/avr/attiny-261_461_861.xml | 6 +- devices/avr/attiny-40.xml | 2 +- devices/avr/attiny-441_841.xml | 10 +- devices/avr/attiny-48_88.xml | 4 +- devices/avr/attiny-4_5_9_10.xml | 2 +- devices/nrf/nrf52810.xml | 44 ++--- devices/nrf/nrf52811.xml | 50 ++--- devices/nrf/nrf52820.xml | 64 +++---- devices/nrf/nrf52832.xml | 80 ++++---- devices/nrf/nrf52833.xml | 86 ++++----- devices/nrf/nrf52840.xml | 86 ++++----- devices/sam/samd21.xml | 48 ++--- devices/sam/samd51.xml | 50 ++--- devices/sam/saml21.xml | 32 ++-- devices/stm32/stm32f0-30.xml | 64 +++---- devices/stm32/stm32f0-31.xml | 43 ++--- devices/stm32/stm32f0-38.xml | 43 ++--- devices/stm32/stm32f0-42.xml | 52 +++--- devices/stm32/stm32f0-48.xml | 48 ++--- devices/stm32/stm32f0-51.xml | 62 +++---- devices/stm32/stm32f0-58.xml | 60 +++--- devices/stm32/stm32f0-70.xml | 56 +++--- devices/stm32/stm32f0-71.xml | 70 +++---- devices/stm32/stm32f0-72.xml | 74 ++++---- devices/stm32/stm32f0-78.xml | 70 +++---- devices/stm32/stm32f0-91.xml | 85 ++++----- devices/stm32/stm32f0-98.xml | 85 ++++----- devices/stm32/stm32f1-00-4_6.xml | 37 ++-- devices/stm32/stm32f1-00-8_b.xml | 45 +++-- devices/stm32/stm32f1-00-c_d_e.xml | 61 +++--- devices/stm32/stm32f1-01-c_d_e.xml | 45 +++-- devices/stm32/stm32f1-01-f_g.xml | 57 +++--- devices/stm32/stm32f1-01_02-4_6.xml | 24 ++- devices/stm32/stm32f1-01_02-8_b.xml | 32 ++-- devices/stm32/stm32f1-03-4_6.xml | 32 ++-- devices/stm32/stm32f1-03-8_b.xml | 40 ++-- devices/stm32/stm32f1-03-c_d_e.xml | 61 +++--- devices/stm32/stm32f1-03-f_g.xml | 73 ++++---- devices/stm32/stm32f1-05_07.xml | 58 +++--- devices/stm32/stm32f2-05.xml | 81 ++++---- devices/stm32/stm32f2-07_15_17.xml | 81 ++++---- devices/stm32/stm32f3-01.xml | 72 +++----- devices/stm32/stm32f3-02-6_8.xml | 76 ++++---- devices/stm32/stm32f3-02-b_c_d_e.xml | 108 +++++------ devices/stm32/stm32f3-03-6_8.xml | 73 +++----- devices/stm32/stm32f3-03-b_c_d_e.xml | 134 +++++++------- devices/stm32/stm32f3-18_28.xml | 91 ++++----- devices/stm32/stm32f3-34.xml | 75 ++++---- devices/stm32/stm32f3-58_98.xml | 134 +++++++------- devices/stm32/stm32f3-73_78.xml | 98 +++++----- devices/stm32/stm32f4-01_11.xml | 61 +++--- devices/stm32/stm32f4-05_07_15_17.xml | 81 ++++---- devices/stm32/stm32f4-10.xml | 51 +++-- devices/stm32/stm32f4-12.xml | 82 ++++----- devices/stm32/stm32f4-13_23.xml | 107 ++++++----- devices/stm32/stm32f4-27_29_37_39.xml | 94 +++++----- devices/stm32/stm32f4-46.xml | 92 +++++---- devices/stm32/stm32f4-69_79.xml | 94 +++++----- devices/stm32/stm32f7-22_23_32_33.xml | 121 ++++++------ devices/stm32/stm32f7-30_50.xml | 129 +++++++------ devices/stm32/stm32f7-45_46_56.xml | 121 ++++++------ .../stm32/stm32f7-65_67_68_69_77_78_79.xml | 127 ++++++------- devices/stm32/stm32g0-30.xml | 52 +++--- devices/stm32/stm32g0-31_41.xml | 60 +++--- devices/stm32/stm32g0-70_b0.xml | 78 ++++---- devices/stm32/stm32g0-71_81.xml | 89 ++++----- devices/stm32/stm32g0-b1_c1.xml | 105 +++++------ devices/stm32/stm32g4-31_41.xml | 107 +++++------ devices/stm32/stm32g4-71_91_a1.xml | 125 ++++++------- devices/stm32/stm32g4-73_83.xml | 145 +++++++-------- devices/stm32/stm32g4-74_84.xml | 147 +++++++-------- devices/stm32/stm32h7-23_33.xml | 168 ++++++++--------- devices/stm32/stm32h7-25_35.xml | 174 +++++++++--------- devices/stm32/stm32h7-30.xml | 168 ++++++++--------- devices/stm32/stm32h7-42.xml | 150 +++++++-------- devices/stm32/stm32h7-43_53.xml | 150 +++++++-------- devices/stm32/stm32h7-45_55.xml | 158 ++++++++-------- devices/stm32/stm32h7-47_57.xml | 158 ++++++++-------- devices/stm32/stm32h7-50.xml | 150 +++++++-------- devices/stm32/stm32h7-a3.xml | 164 +++++++++-------- devices/stm32/stm32h7-b0.xml | 156 ++++++++-------- devices/stm32/stm32h7-b3.xml | 170 ++++++++--------- devices/stm32/stm32l0-10.xml | 38 ++-- devices/stm32/stm32l0-11_21.xml | 36 ++-- devices/stm32/stm32l0-31_41.xml | 38 ++-- devices/stm32/stm32l0-51_52_53_62_63.xml | 52 +++--- devices/stm32/stm32l0-71_72_73_81_82_83.xml | 68 ++++--- devices/stm32/stm32l1-00.xml | 62 +++---- devices/stm32/stm32l1-51_52-6_8_b.xml | 50 +++-- devices/stm32/stm32l1-51_52_62-c_d_e.xml | 68 +++---- devices/stm32/stm32l4-12_22.xml | 55 +++--- devices/stm32/stm32l4-31_33_43.xml | 71 ++++--- devices/stm32/stm32l4-32_42.xml | 63 +++---- devices/stm32/stm32l4-51_71.xml | 105 +++++------ devices/stm32/stm32l4-52_62.xml | 79 ++++---- devices/stm32/stm32l4-75_85.xml | 99 +++++----- devices/stm32/stm32l4-76_86.xml | 99 +++++----- devices/stm32/stm32l4-96_a6.xml | 109 +++++------ devices/stm32/stm32l4-p5.xml | 103 ++++++----- devices/stm32/stm32l4-q5.xml | 103 ++++++----- devices/stm32/stm32l4-r5_r7_r9.xml | 99 +++++----- devices/stm32/stm32l4-s5_s7_s9.xml | 99 +++++----- devices/stm32/stm32wb-30_50.xml | 44 ++--- devices/stm32/stm32wb-35_55.xml | 58 +++--- devices/stm32/stm32wb-5m.xml | 58 +++--- tools/generator/dfg/avr/avr_device_tree.py | 4 +- tools/generator/dfg/nrf/nrf_device_tree.py | 4 +- tools/generator/dfg/sam/sam_device_tree.py | 4 +- tools/generator/dfg/stm32/stm_device_tree.py | 59 +++--- tools/generator/dfg/stm32/stm_header.py | 7 +- tools/generator/dfg/stm32/stm_peripherals.py | 118 +++--------- 130 files changed, 4189 insertions(+), 4649 deletions(-) diff --git a/devices/avr/at90-32_64_128-can.xml b/devices/avr/at90-32_64_128-can.xml index 00aeec1b..1922f0d3 100644 --- a/devices/avr/at90-32_64_128-can.xml +++ b/devices/avr/at90-32_64_128-can.xml @@ -24,19 +24,19 @@ - - + + - + - + - - + + diff --git a/devices/avr/atmega-1281_2561.xml b/devices/avr/atmega-1281_2561.xml index 78adde6f..11cece03 100644 --- a/devices/avr/atmega-1281_2561.xml +++ b/devices/avr/atmega-1281_2561.xml @@ -27,21 +27,21 @@ - - - - + + + + - + - + - - + + diff --git a/devices/avr/atmega-1284-n_p.xml b/devices/avr/atmega-1284-n_p.xml index cfeacc2a..62e78a70 100644 --- a/devices/avr/atmega-1284-n_p.xml +++ b/devices/avr/atmega-1284-n_p.xml @@ -20,19 +20,19 @@ - - + + - + - + - - + + diff --git a/devices/avr/atmega-164_324_644-a_n_p_pa_pv_v.xml b/devices/avr/atmega-164_324_644-a_n_p_pa_pv_v.xml index 7687476a..8164a6eb 100644 --- a/devices/avr/atmega-164_324_644-a_n_p_pa_pv_v.xml +++ b/devices/avr/atmega-164_324_644-a_n_p_pa_pv_v.xml @@ -101,18 +101,18 @@ - + - + - + - - + + diff --git a/devices/avr/atmega-169_329_649.xml b/devices/avr/atmega-169_329_649.xml index 7a6840db..6514d85c 100644 --- a/devices/avr/atmega-169_329_649.xml +++ b/devices/avr/atmega-169_329_649.xml @@ -73,16 +73,16 @@ - + - + - + - + diff --git a/devices/avr/atmega-16_32-u4_u4rc.xml b/devices/avr/atmega-16_32-u4_u4rc.xml index 3aea2c61..461f259c 100644 --- a/devices/avr/atmega-16_32-u4_u4rc.xml +++ b/devices/avr/atmega-16_32-u4_u4rc.xml @@ -21,18 +21,18 @@ - + - - + + - + - + diff --git a/devices/avr/atmega-16_32_64-c1_m1.xml b/devices/avr/atmega-16_32_64-c1_m1.xml index ac4add88..6c49de82 100644 --- a/devices/avr/atmega-16_32_64-c1_m1.xml +++ b/devices/avr/atmega-16_32_64-c1_m1.xml @@ -31,10 +31,10 @@ - + - + diff --git a/devices/avr/atmega-324-pb.xml b/devices/avr/atmega-324-pb.xml index 6d41620f..ea8cafe7 100644 --- a/devices/avr/atmega-324-pb.xml +++ b/devices/avr/atmega-324-pb.xml @@ -17,28 +17,28 @@ - - + + - - - + + + - + - + - - + + - - - + + + diff --git a/devices/avr/atmega-48_88_168_328-a_n_p_pa_pv_v.xml b/devices/avr/atmega-48_88_168_328-a_n_p_pa_pv_v.xml index 94405ff0..13917353 100644 --- a/devices/avr/atmega-48_88_168_328-a_n_p_pa_pv_v.xml +++ b/devices/avr/atmega-48_88_168_328-a_n_p_pa_pv_v.xml @@ -125,17 +125,17 @@ - + - + - + - + diff --git a/devices/avr/atmega-48_88_168_328-pb.xml b/devices/avr/atmega-48_88_168_328-pb.xml index 025946a7..f964bced 100644 --- a/devices/avr/atmega-48_88_168_328-pb.xml +++ b/devices/avr/atmega-48_88_168_328-pb.xml @@ -28,27 +28,27 @@ - - + + - - - + + + - + - + - - + + - - + + diff --git a/devices/avr/atmega-640_1280_2560.xml b/devices/avr/atmega-640_1280_2560.xml index 97dc3c5d..8b4e2b4c 100644 --- a/devices/avr/atmega-640_1280_2560.xml +++ b/devices/avr/atmega-640_1280_2560.xml @@ -33,23 +33,23 @@ - - - - + + + + - + - + - - - - + + + + diff --git a/devices/avr/atmega-64_128-a_l_n.xml b/devices/avr/atmega-64_128-a_l_n.xml index 6a37c9f9..a23dce81 100644 --- a/devices/avr/atmega-64_128-a_l_n.xml +++ b/devices/avr/atmega-64_128-a_l_n.xml @@ -43,19 +43,19 @@ - - + + - + - + - - + + diff --git a/devices/avr/atmega-8_16_32-a_l_n.xml b/devices/avr/atmega-8_16_32-a_l_n.xml index 20a2ced8..30af7d35 100644 --- a/devices/avr/atmega-8_16_32-a_l_n.xml +++ b/devices/avr/atmega-8_16_32-a_l_n.xml @@ -61,13 +61,13 @@ - + - + - + diff --git a/devices/avr/atmega-8_16_32-u2.xml b/devices/avr/atmega-8_16_32-u2.xml index e30bf4f2..2815a0f4 100644 --- a/devices/avr/atmega-8_16_32-u2.xml +++ b/devices/avr/atmega-8_16_32-u2.xml @@ -22,13 +22,13 @@ - + - + - + diff --git a/devices/avr/attiny-102_104.xml b/devices/avr/attiny-102_104.xml index 85e2ab70..adbcf656 100644 --- a/devices/avr/attiny-102_104.xml +++ b/devices/avr/attiny-102_104.xml @@ -17,7 +17,7 @@ - + diff --git a/devices/avr/attiny-13.xml b/devices/avr/attiny-13.xml index 1c3f3f29..1222a2ea 100644 --- a/devices/avr/attiny-13.xml +++ b/devices/avr/attiny-13.xml @@ -37,7 +37,7 @@ - + diff --git a/devices/avr/attiny-20.xml b/devices/avr/attiny-20.xml index bfac2548..9a6515ae 100644 --- a/devices/avr/attiny-20.xml +++ b/devices/avr/attiny-20.xml @@ -14,10 +14,10 @@ - + - + diff --git a/devices/avr/attiny-24_44_84.xml b/devices/avr/attiny-24_44_84.xml index e5dfeed1..4346ed6a 100644 --- a/devices/avr/attiny-24_44_84.xml +++ b/devices/avr/attiny-24_44_84.xml @@ -27,10 +27,10 @@ - + - + diff --git a/devices/avr/attiny-25_45_85.xml b/devices/avr/attiny-25_45_85.xml index c00dc64a..8d40407b 100644 --- a/devices/avr/attiny-25_45_85.xml +++ b/devices/avr/attiny-25_45_85.xml @@ -48,11 +48,11 @@ - + - - + + diff --git a/devices/avr/attiny-261_461_861.xml b/devices/avr/attiny-261_461_861.xml index 6fc9a0fa..31621267 100644 --- a/devices/avr/attiny-261_461_861.xml +++ b/devices/avr/attiny-261_461_861.xml @@ -42,11 +42,11 @@ - + - - + + diff --git a/devices/avr/attiny-40.xml b/devices/avr/attiny-40.xml index 5c2b09c9..f0b9d8a1 100644 --- a/devices/avr/attiny-40.xml +++ b/devices/avr/attiny-40.xml @@ -14,7 +14,7 @@ - + diff --git a/devices/avr/attiny-441_841.xml b/devices/avr/attiny-441_841.xml index d5792d7c..606c9534 100644 --- a/devices/avr/attiny-441_841.xml +++ b/devices/avr/attiny-441_841.xml @@ -19,17 +19,17 @@ - - + + - + - - + + diff --git a/devices/avr/attiny-48_88.xml b/devices/avr/attiny-48_88.xml index 76d48518..4fc72fde 100644 --- a/devices/avr/attiny-48_88.xml +++ b/devices/avr/attiny-48_88.xml @@ -19,10 +19,10 @@ - + - + diff --git a/devices/avr/attiny-4_5_9_10.xml b/devices/avr/attiny-4_5_9_10.xml index 4134b873..3ed02773 100644 --- a/devices/avr/attiny-4_5_9_10.xml +++ b/devices/avr/attiny-4_5_9_10.xml @@ -18,7 +18,7 @@ - + diff --git a/devices/nrf/nrf52810.xml b/devices/nrf/nrf52810.xml index 956965c9..9fc4f962 100644 --- a/devices/nrf/nrf52810.xml +++ b/devices/nrf/nrf52810.xml @@ -42,8 +42,8 @@ - - + + @@ -52,53 +52,53 @@ - + - - + + - + - + - + - - - - - - + + + + + + - - - + + + - + - + - + - + - + diff --git a/devices/nrf/nrf52811.xml b/devices/nrf/nrf52811.xml index e6cbeea4..6b0e13d7 100644 --- a/devices/nrf/nrf52811.xml +++ b/devices/nrf/nrf52811.xml @@ -42,8 +42,8 @@ - - + + @@ -52,56 +52,56 @@ - + - - + + - - + + - - + + - - + + - - - - - - + + + + + + - - - + + + - + - + - + - + - + diff --git a/devices/nrf/nrf52820.xml b/devices/nrf/nrf52820.xml index 3ed75754..59e0772e 100644 --- a/devices/nrf/nrf52820.xml +++ b/devices/nrf/nrf52820.xml @@ -41,12 +41,12 @@ - - - - - - + + + + + + @@ -57,53 +57,53 @@ - - + + - - + + - - + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + - - + + - - + + - + - + diff --git a/devices/nrf/nrf52832.xml b/devices/nrf/nrf52832.xml index 23da70c8..26cf7512 100644 --- a/devices/nrf/nrf52832.xml +++ b/devices/nrf/nrf52832.xml @@ -55,12 +55,12 @@ - - - - - - + + + + + + @@ -74,67 +74,67 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - + + - - + + - + - + diff --git a/devices/nrf/nrf52833.xml b/devices/nrf/nrf52833.xml index 3fef5258..a4854cf9 100644 --- a/devices/nrf/nrf52833.xml +++ b/devices/nrf/nrf52833.xml @@ -56,12 +56,12 @@ - - - - - - + + + + + + @@ -75,70 +75,70 @@ - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + diff --git a/devices/nrf/nrf52840.xml b/devices/nrf/nrf52840.xml index dfd73e9a..d4b2be0c 100644 --- a/devices/nrf/nrf52840.xml +++ b/devices/nrf/nrf52840.xml @@ -61,12 +61,12 @@ - - - - - - + + + + + + @@ -80,71 +80,71 @@ - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + diff --git a/devices/sam/samd21.xml b/devices/sam/samd21.xml index 408fb85a..3b1bbb34 100644 --- a/devices/sam/samd21.xml +++ b/devices/sam/samd21.xml @@ -218,8 +218,8 @@ - - + + @@ -232,38 +232,38 @@ - - - + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + diff --git a/devices/sam/samd51.xml b/devices/sam/samd51.xml index be5e179b..57e546ae 100644 --- a/devices/sam/samd51.xml +++ b/devices/sam/samd51.xml @@ -189,8 +189,8 @@ - - + + @@ -225,36 +225,36 @@ - - + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + diff --git a/devices/sam/saml21.xml b/devices/sam/saml21.xml index 45570887..8be6ff10 100644 --- a/devices/sam/saml21.xml +++ b/devices/sam/saml21.xml @@ -119,27 +119,27 @@ - - - - - - - - + + + + + + + + - - - - - + + + + + - - - + + + diff --git a/devices/stm32/stm32f0-30.xml b/devices/stm32/stm32f0-30.xml index 6b5fda3d..d4e8f286 100644 --- a/devices/stm32/stm32f0-30.xml +++ b/devices/stm32/stm32f0-30.xml @@ -47,10 +47,7 @@ - - - - + @@ -58,54 +55,49 @@ - - - - + + - - - + - - - - - - - + + + - + - - + + - - - - - + + + + + - - - - - - - + + + + + + + + + + - + @@ -213,8 +205,8 @@ - - + + diff --git a/devices/stm32/stm32f0-31.xml b/devices/stm32/stm32f0-31.xml index e9706a92..22cb1e1d 100644 --- a/devices/stm32/stm32f0-31.xml +++ b/devices/stm32/stm32f0-31.xml @@ -48,10 +48,7 @@ - - - - + @@ -59,46 +56,40 @@ - - - + - + - - - + - - - - - - + + - + - - - - - + + + + + - - + + + + - + diff --git a/devices/stm32/stm32f0-38.xml b/devices/stm32/stm32f0-38.xml index b3e9e730..90e3fd52 100644 --- a/devices/stm32/stm32f0-38.xml +++ b/devices/stm32/stm32f0-38.xml @@ -35,10 +35,7 @@ - - - - + @@ -46,46 +43,40 @@ - - - + - + - - - + - - - - - - + + - + - - - - - + + + + + - - + + + + - + diff --git a/devices/stm32/stm32f0-42.xml b/devices/stm32/stm32f0-42.xml index 4559f7cc..958b82e4 100644 --- a/devices/stm32/stm32f0-42.xml +++ b/devices/stm32/stm32f0-42.xml @@ -55,13 +55,8 @@ - - - - - - - + + @@ -70,50 +65,45 @@ - - - + - + - - - + - - - - - - - + + + - + - - - - - + + + + + - - - + + + + + + - + diff --git a/devices/stm32/stm32f0-48.xml b/devices/stm32/stm32f0-48.xml index 7096e7be..3abf62ef 100644 --- a/devices/stm32/stm32f0-48.xml +++ b/devices/stm32/stm32f0-48.xml @@ -38,10 +38,7 @@ - - - - + @@ -50,50 +47,45 @@ - - - + - + - - - + - - - - - - - + + + - + - - - - - + + + + + - - - + + + + + + - + diff --git a/devices/stm32/stm32f0-51.xml b/devices/stm32/stm32f0-51.xml index a4c84582..d888ee7d 100644 --- a/devices/stm32/stm32f0-51.xml +++ b/devices/stm32/stm32f0-51.xml @@ -70,16 +70,12 @@ - - - - - - + + + - - + @@ -89,55 +85,49 @@ - - - - + + - + - - - + - - - - - - - - + + + + - + - + - - - - - - + + + + + + - - - + + + + + - + diff --git a/devices/stm32/stm32f0-58.xml b/devices/stm32/stm32f0-58.xml index 9c551ba7..0cfa3a37 100644 --- a/devices/stm32/stm32f0-58.xml +++ b/devices/stm32/stm32f0-58.xml @@ -43,16 +43,12 @@ - - - - - - + + + - - + @@ -62,54 +58,48 @@ - - - - + + - + - - - + - - - - - - - + + + - + - + - - - - - - + + + + + + - - - + + + + + - + diff --git a/devices/stm32/stm32f0-70.xml b/devices/stm32/stm32f0-70.xml index 2e7a8b7c..f412b1da 100644 --- a/devices/stm32/stm32f0-70.xml +++ b/devices/stm32/stm32f0-70.xml @@ -42,10 +42,7 @@ - - - - + @@ -53,53 +50,48 @@ - - - - + + - - - + - - - - - - - + + + - + - - + + - - - - - + + + + + - - - - - + + + + + + + + - + diff --git a/devices/stm32/stm32f0-71.xml b/devices/stm32/stm32f0-71.xml index 530a4040..dca7280d 100644 --- a/devices/stm32/stm32f0-71.xml +++ b/devices/stm32/stm32f0-71.xml @@ -57,16 +57,11 @@ - - - - - - - - - + + + + @@ -75,58 +70,53 @@ - - - - + + - - + + - - - + - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - - - + + + + + + + + - + diff --git a/devices/stm32/stm32f0-72.xml b/devices/stm32/stm32f0-72.xml index 31d3615a..79787bd6 100644 --- a/devices/stm32/stm32f0-72.xml +++ b/devices/stm32/stm32f0-72.xml @@ -63,20 +63,13 @@ - - - + - - - - - - - - - + + + + @@ -85,59 +78,54 @@ - - - - + + - - + + - - - + - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - - - + + + + + + + + - + diff --git a/devices/stm32/stm32f0-78.xml b/devices/stm32/stm32f0-78.xml index 4b83954a..c6ee62cf 100644 --- a/devices/stm32/stm32f0-78.xml +++ b/devices/stm32/stm32f0-78.xml @@ -50,16 +50,11 @@ - - - - - - - - - + + + + @@ -68,59 +63,54 @@ - - - - + + - - + + - - - + - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - - - + + + + + + + + - + diff --git a/devices/stm32/stm32f0-91.xml b/devices/stm32/stm32f0-91.xml index 8c20614b..120f1107 100644 --- a/devices/stm32/stm32f0-91.xml +++ b/devices/stm32/stm32f0-91.xml @@ -61,20 +61,13 @@ - - - + - - - - - - - - - + + + + @@ -83,64 +76,58 @@ - - - - + + - - + + - - - + - - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + + + + - - + + diff --git a/devices/stm32/stm32f0-98.xml b/devices/stm32/stm32f0-98.xml index f5cdd3d8..80b8f125 100644 --- a/devices/stm32/stm32f0-98.xml +++ b/devices/stm32/stm32f0-98.xml @@ -48,20 +48,13 @@ - - - + - - - - - - - - - + + + + @@ -70,64 +63,58 @@ - - - - + + - - + + - - - + - - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + + + + - - + + diff --git a/devices/stm32/stm32f1-00-4_6.xml b/devices/stm32/stm32f1-00-4_6.xml index 51f44558..470306c5 100644 --- a/devices/stm32/stm32f1-00-4_6.xml +++ b/devices/stm32/stm32f1-00-4_6.xml @@ -58,7 +58,7 @@ - + @@ -69,40 +69,39 @@ - + - - - - - + + - + - - + + - - - - - + + + + + - - + + + + - - + + diff --git a/devices/stm32/stm32f1-00-8_b.xml b/devices/stm32/stm32f1-00-8_b.xml index 2d3328a0..b0cfaefe 100644 --- a/devices/stm32/stm32f1-00-8_b.xml +++ b/devices/stm32/stm32f1-00-8_b.xml @@ -60,7 +60,7 @@ - + @@ -71,44 +71,43 @@ - - + + - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - + + + + + - - + + diff --git a/devices/stm32/stm32f1-00-c_d_e.xml b/devices/stm32/stm32f1-00-c_d_e.xml index 9ff54915..06ef4313 100644 --- a/devices/stm32/stm32f1-00-c_d_e.xml +++ b/devices/stm32/stm32f1-00-c_d_e.xml @@ -70,7 +70,7 @@ - + @@ -82,53 +82,54 @@ - - + + - - - - - - - + + + + - + - - + + - - - - - - - - - - + + + + + + + + + + - - + + + + - - - + + + + + - - + + diff --git a/devices/stm32/stm32f1-01-c_d_e.xml b/devices/stm32/stm32f1-01-c_d_e.xml index 50f36891..50e660ac 100644 --- a/devices/stm32/stm32f1-01-c_d_e.xml +++ b/devices/stm32/stm32f1-01-c_d_e.xml @@ -56,7 +56,7 @@ - + @@ -69,44 +69,43 @@ - - + + - - - - - - - + + + + - - + + - - - - + + + + - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-01-f_g.xml b/devices/stm32/stm32f1-01-f_g.xml index 1f764349..d5cc0dc2 100644 --- a/devices/stm32/stm32f1-01-f_g.xml +++ b/devices/stm32/stm32f1-01-f_g.xml @@ -60,7 +60,7 @@ - + @@ -73,50 +73,49 @@ - - + + - - - - - - - + + + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-01_02-4_6.xml b/devices/stm32/stm32f1-01_02-4_6.xml index ac686079..0744ce5f 100644 --- a/devices/stm32/stm32f1-01_02-4_6.xml +++ b/devices/stm32/stm32f1-01_02-4_6.xml @@ -52,7 +52,7 @@ - + @@ -63,31 +63,29 @@ - + - - - - - + + - - + + - - + + + - - + + diff --git a/devices/stm32/stm32f1-01_02-8_b.xml b/devices/stm32/stm32f1-01_02-8_b.xml index 6432d47c..49057530 100644 --- a/devices/stm32/stm32f1-01_02-8_b.xml +++ b/devices/stm32/stm32f1-01_02-8_b.xml @@ -62,7 +62,7 @@ - + @@ -73,35 +73,33 @@ - - + + - - - - - - + + + - - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-03-4_6.xml b/devices/stm32/stm32f1-03-4_6.xml index 6881a3a3..4a1ba0c2 100644 --- a/devices/stm32/stm32f1-03-4_6.xml +++ b/devices/stm32/stm32f1-03-4_6.xml @@ -66,12 +66,10 @@ - - - - - + + + @@ -81,34 +79,32 @@ - + - - - - - + + - + - - + + - - + + + - - + + diff --git a/devices/stm32/stm32f1-03-8_b.xml b/devices/stm32/stm32f1-03-8_b.xml index e4cc8c88..d533f563 100644 --- a/devices/stm32/stm32f1-03-8_b.xml +++ b/devices/stm32/stm32f1-03-8_b.xml @@ -77,12 +77,10 @@ - - - - - + + + @@ -92,38 +90,36 @@ - - + + - - - - - - + + + - + - - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-03-c_d_e.xml b/devices/stm32/stm32f1-03-c_d_e.xml index 5d879f7c..479de95b 100644 --- a/devices/stm32/stm32f1-03-c_d_e.xml +++ b/devices/stm32/stm32f1-03-c_d_e.xml @@ -91,13 +91,11 @@ - - - - - - + + + + @@ -109,54 +107,53 @@ - - + + - - + + - - - - - - - + + + + - - + + - - + + - - - - + + + + - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-03-f_g.xml b/devices/stm32/stm32f1-03-f_g.xml index a804177d..67fe3427 100644 --- a/devices/stm32/stm32f1-03-f_g.xml +++ b/devices/stm32/stm32f1-03-f_g.xml @@ -77,13 +77,11 @@ - - - - - - + + + + @@ -95,60 +93,59 @@ - - + + - - + + - - - - - - - + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f1-05_07.xml b/devices/stm32/stm32f1-05_07.xml index c8c4387b..8cdec019 100644 --- a/devices/stm32/stm32f1-05_07.xml +++ b/devices/stm32/stm32f1-05_07.xml @@ -93,13 +93,12 @@ - - + + - - - + + @@ -112,52 +111,51 @@ - - + + - - + + - - - - - - - + + + + - + - - + + - - - - + + + + - - + + + - - - + + + + - - + + diff --git a/devices/stm32/stm32f2-05.xml b/devices/stm32/stm32f2-05.xml index e1846e79..fbbea86f 100644 --- a/devices/stm32/stm32f2-05.xml +++ b/devices/stm32/stm32f2-05.xml @@ -124,19 +124,16 @@ - - - + + + - - - + + - - - + @@ -173,13 +170,13 @@ - - - + + + - - + + @@ -187,51 +184,51 @@ - - - - - - + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f2-07_15_17.xml b/devices/stm32/stm32f2-07_15_17.xml index ee55294d..e6517bdb 100644 --- a/devices/stm32/stm32f2-07_15_17.xml +++ b/devices/stm32/stm32f2-07_15_17.xml @@ -135,20 +135,17 @@ - - - + + + - - - + + - - - + @@ -188,13 +185,13 @@ - - - + + + - - + + @@ -202,51 +199,51 @@ - - - - - - + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f3-01.xml b/devices/stm32/stm32f3-01.xml index f02e921c..b9f8839b 100644 --- a/devices/stm32/stm32f3-01.xml +++ b/devices/stm32/stm32f3-01.xml @@ -67,20 +67,15 @@ - + - - - - - - - - - - + + + + + @@ -89,60 +84,53 @@ - - - - - + + + - - + + - - - + - + - - - - - - - - - + + + - + - + - - - - + + + + - - - - + + + + + + + - + diff --git a/devices/stm32/stm32f3-02-6_8.xml b/devices/stm32/stm32f3-02-6_8.xml index 7962d134..d1b473cd 100644 --- a/devices/stm32/stm32f3-02-6_8.xml +++ b/devices/stm32/stm32f3-02-6_8.xml @@ -70,23 +70,16 @@ - - - - + + - - - - - - - - - - + + + + + @@ -95,61 +88,54 @@ - - - - - + + + - - + + - - - + - + - - - - - - - - - + + + - + - + - - - - + + + + - - - - + + + + + + + - + diff --git a/devices/stm32/stm32f3-02-b_c_d_e.xml b/devices/stm32/stm32f3-02-b_c_d_e.xml index 03451ca1..21a6de0d 100644 --- a/devices/stm32/stm32f3-02-b_c_d_e.xml +++ b/devices/stm32/stm32f3-02-b_c_d_e.xml @@ -99,31 +99,25 @@ - - - - - + + + - - - - + + + + - - - - - - - - + + + + + - - + @@ -134,72 +128,68 @@ - - - - - + + + - - + + - - - + - - + + - - - - - - - - - - - + + + + + - + - + - - - - - - + + + + + + - - - + + + + + + - - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32f3-03-6_8.xml b/devices/stm32/stm32f3-03-6_8.xml index 0a9e36c4..fd1c609c 100644 --- a/devices/stm32/stm32f3-03-6_8.xml +++ b/devices/stm32/stm32f3-03-6_8.xml @@ -63,25 +63,19 @@ - - - - - + + + - - - - - - - + + + + - - - + + @@ -91,55 +85,48 @@ - - - + - - - + - + - - - - - - - - + + - + - - + + - - - - - + + + + + - - - - + + + + + + + - + diff --git a/devices/stm32/stm32f3-03-b_c_d_e.xml b/devices/stm32/stm32f3-03-b_c_d_e.xml index 82ac2303..bbf45e9e 100644 --- a/devices/stm32/stm32f3-03-b_c_d_e.xml +++ b/devices/stm32/stm32f3-03-b_c_d_e.xml @@ -119,39 +119,33 @@ - - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + - - + @@ -163,77 +157,73 @@ - - - - - + + + - - + + - - - + - - - - + + + + - - - - - - - - - - - + + + + + - - - + + + - - + + - - - - - - + + + + + + - - - + + + + + + - - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32f3-18_28.xml b/devices/stm32/stm32f3-18_28.xml index 08e5b583..95321677 100644 --- a/devices/stm32/stm32f3-18_28.xml +++ b/devices/stm32/stm32f3-18_28.xml @@ -65,30 +65,24 @@ - - - - - + + + - - - + + + - - - - - - - + + + + - - - + + @@ -98,63 +92,56 @@ - - - - - + + + - - + + - - - + - + - - - - - - - - - - + + + + - + - - + + - - - - - + + + + + - - - - + + + + + + + - + diff --git a/devices/stm32/stm32f3-34.xml b/devices/stm32/stm32f3-34.xml index 5c810e19..d937c71b 100644 --- a/devices/stm32/stm32f3-34.xml +++ b/devices/stm32/stm32f3-34.xml @@ -82,25 +82,19 @@ - - - - - + + + - - - - - - - + + + + - - - + + @@ -110,58 +104,51 @@ - + - - - + - - - + - + - - - - - - - - + + - + - - + + - - - - - + + + + + - - - - + + + + + + + - + diff --git a/devices/stm32/stm32f3-58_98.xml b/devices/stm32/stm32f3-58_98.xml index 58f1671e..3faf85e5 100644 --- a/devices/stm32/stm32f3-58_98.xml +++ b/devices/stm32/stm32f3-58_98.xml @@ -85,39 +85,33 @@ - - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + - - + @@ -128,76 +122,72 @@ - - - - - + + + - - + + - - - + - - - - + + + + - - - - - - - - - - - + + + + + - - - + + + - - + + - - - - - - + + + + + + - - - + + + + + + - - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32f3-73_78.xml b/devices/stm32/stm32f3-73_78.xml index b23f8e97..b44003cf 100644 --- a/devices/stm32/stm32f3-73_78.xml +++ b/devices/stm32/stm32f3-73_78.xml @@ -100,23 +100,17 @@ - - - - + + - - - - - - + + + - - - + + @@ -127,73 +121,65 @@ - - - - + + - - - + + + - - - + - - - + + + - - - - - - - - - - + + + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - + + + + + + - - + + diff --git a/devices/stm32/stm32f4-01_11.xml b/devices/stm32/stm32f4-01_11.xml index f6e0a748..1f5d0a42 100644 --- a/devices/stm32/stm32f4-01_11.xml +++ b/devices/stm32/stm32f4-01_11.xml @@ -123,7 +123,7 @@ - + @@ -163,16 +163,16 @@ - - - + + + - - - - - + + + + + @@ -180,39 +180,38 @@ - - - - - - - - - + + + + + + + - + - - - - - - - + + + + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32f4-05_07_15_17.xml b/devices/stm32/stm32f4-05_07_15_17.xml index 6735e781..c75ce799 100644 --- a/devices/stm32/stm32f4-05_07_15_17.xml +++ b/devices/stm32/stm32f4-05_07_15_17.xml @@ -133,20 +133,17 @@ - - - + + + - - - + + - - - + @@ -191,13 +188,13 @@ - - - + + + - - + + @@ -205,51 +202,51 @@ - - - - - - + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f4-10.xml b/devices/stm32/stm32f4-10.xml index e62a3b6c..ad710afe 100644 --- a/devices/stm32/stm32f4-10.xml +++ b/devices/stm32/stm32f4-10.xml @@ -85,12 +85,10 @@ - + - - - + @@ -124,53 +122,52 @@ - + - - + + - - - + + + - + - - - - - - + + + + - + - + - - - + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32f4-12.xml b/devices/stm32/stm32f4-12.xml index 6b281259..450e39eb 100644 --- a/devices/stm32/stm32f4-12.xml +++ b/devices/stm32/stm32f4-12.xml @@ -114,16 +114,15 @@ - + - - - + + - + @@ -158,20 +157,20 @@ - + - - - + + + - - - - - + + + + + @@ -180,47 +179,46 @@ - - - - - - - - + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f4-13_23.xml b/devices/stm32/stm32f4-13_23.xml index 1432d0fd..4c644b41 100644 --- a/devices/stm32/stm32f4-13_23.xml +++ b/devices/stm32/stm32f4-13_23.xml @@ -169,22 +169,19 @@ - + - - - - + + + - - - + - - + + @@ -219,84 +216,84 @@ - + - - - + + + - - - - - + + + + + - + - + - - - - - - - - + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f4-27_29_37_39.xml b/devices/stm32/stm32f4-27_29_37_39.xml index c5963df0..a7486d96 100644 --- a/devices/stm32/stm32f4-27_29_37_39.xml +++ b/devices/stm32/stm32f4-27_29_37_39.xml @@ -179,20 +179,17 @@ - - - + + + - - - + + - - - + @@ -241,14 +238,13 @@ - - - - + + + - - + + @@ -256,60 +252,60 @@ - + - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - - - + + + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f4-46.xml b/devices/stm32/stm32f4-46.xml index dba4c81b..5cdb7398 100644 --- a/devices/stm32/stm32f4-46.xml +++ b/devices/stm32/stm32f4-46.xml @@ -117,19 +117,16 @@ - - - + + + - - - + + - - - + @@ -175,77 +172,76 @@ - + - - - - + + + - - - + + + - - + + - - - - - - - + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f4-69_79.xml b/devices/stm32/stm32f4-69_79.xml index 45daf629..0ab2a188 100644 --- a/devices/stm32/stm32f4-69_79.xml +++ b/devices/stm32/stm32f4-69_79.xml @@ -153,20 +153,17 @@ - - - + + + - - - + + - - - + @@ -216,14 +213,13 @@ - - - - + + + - - + + @@ -232,60 +228,60 @@ - + - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + - - - - + + + + + - - - - + + + + - - + + diff --git a/devices/stm32/stm32f7-22_23_32_33.xml b/devices/stm32/stm32f7-22_23_32_33.xml index ba382ef9..2ba74c81 100644 --- a/devices/stm32/stm32f7-22_23_32_33.xml +++ b/devices/stm32/stm32f7-22_23_32_33.xml @@ -150,22 +150,16 @@ - - - + + + - - - - - - - - - + + + @@ -213,88 +207,89 @@ - - - - - + + + - - - - - - + + + + - + - - + + - - - + + + - - - - - - - - - + + + + + + - - + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + + + + + - - - - + + + + + + + + - - + + diff --git a/devices/stm32/stm32f7-30_50.xml b/devices/stm32/stm32f7-30_50.xml index 49b55a8d..831edaf8 100644 --- a/devices/stm32/stm32f7-30_50.xml +++ b/devices/stm32/stm32f7-30_50.xml @@ -129,24 +129,18 @@ - - - + + + - - - - - - - + + + - - - + @@ -199,23 +193,19 @@ - - - - - - + + + + - - - - - - + + + + - + @@ -223,64 +213,69 @@ - - + + - - + + - - + + - - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + + + + + - - - - + + + + + + + + @@ -288,8 +283,8 @@ - - + + diff --git a/devices/stm32/stm32f7-45_46_56.xml b/devices/stm32/stm32f7-45_46_56.xml index 81adca09..709b0037 100644 --- a/devices/stm32/stm32f7-45_46_56.xml +++ b/devices/stm32/stm32f7-45_46_56.xml @@ -161,23 +161,17 @@ - - - + + + - - - - - - - + + + - - - + @@ -230,23 +224,19 @@ - - - - - - + + + + - - - - - - + + + + - + @@ -254,65 +244,70 @@ - - + + - + - - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + - - - - + + + + + + + + - - + + diff --git a/devices/stm32/stm32f7-65_67_68_69_77_78_79.xml b/devices/stm32/stm32f7-65_67_68_69_77_78_79.xml index 608c1e0c..dacdfff3 100644 --- a/devices/stm32/stm32f7-65_67_68_69_77_78_79.xml +++ b/devices/stm32/stm32f7-65_67_68_69_77_78_79.xml @@ -191,27 +191,21 @@ - - - + + + - - - - - - - - + + + + - - - + - + @@ -265,24 +259,20 @@ - - - - - - + + + + - - - - - - + + + + - + @@ -291,66 +281,71 @@ - - + + - - + + - - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + - - - - + + + + + + + + - - + + diff --git a/devices/stm32/stm32g0-30.xml b/devices/stm32/stm32g0-30.xml index c9a8c03a..fe8564b6 100644 --- a/devices/stm32/stm32g0-30.xml +++ b/devices/stm32/stm32g0-30.xml @@ -38,14 +38,9 @@ - - - - - - - + + @@ -58,49 +53,44 @@ - - - - + + - + - - - + - - - - - - - - + + + - + - - - - + + + + + + + + - - + + - + diff --git a/devices/stm32/stm32g0-31_41.xml b/devices/stm32/stm32g0-31_41.xml index be1f3bd2..c37ec7f2 100644 --- a/devices/stm32/stm32g0-31_41.xml +++ b/devices/stm32/stm32g0-31_41.xml @@ -88,15 +88,10 @@ - - - - + - - - + @@ -109,24 +104,20 @@ - - - - + + - + - - - + - - + + - + @@ -134,33 +125,32 @@ - - - - - - - - + + + - + - - - - - + + + + + + + + + - - + + - + diff --git a/devices/stm32/stm32g0-70_b0.xml b/devices/stm32/stm32g0-70_b0.xml index 5b04cd1d..87565939 100644 --- a/devices/stm32/stm32g0-70_b0.xml +++ b/devices/stm32/stm32g0-70_b0.xml @@ -50,14 +50,9 @@ - - - - - - - + + @@ -70,67 +65,62 @@ - - - - - + + + - + - - + + - - - + - - - - - - - - - + + + + - + - - + + - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - + + diff --git a/devices/stm32/stm32g0-71_81.xml b/devices/stm32/stm32g0-71_81.xml index db0849d0..c1c94088 100644 --- a/devices/stm32/stm32g0-71_81.xml +++ b/devices/stm32/stm32g0-71_81.xml @@ -117,22 +117,16 @@ - - - - + - - - - - + + + - - + @@ -147,24 +141,20 @@ - - - - + + - + - - - + - - + + - + @@ -172,52 +162,51 @@ - - - - - - - - + + + - + - - + + - - - - - - + + + + + + - - - + + + - - - + + + + + + + - - - - + + + + - + diff --git a/devices/stm32/stm32g0-b1_c1.xml b/devices/stm32/stm32g0-b1_c1.xml index f127295f..f70a0887 100644 --- a/devices/stm32/stm32g0-b1_c1.xml +++ b/devices/stm32/stm32g0-b1_c1.xml @@ -85,27 +85,21 @@ - - - - + - - - - - - + + + + - - + - - + + @@ -120,27 +114,23 @@ - - - - - + + + - - + + - - - + - - + + - - + + @@ -148,52 +138,51 @@ - - - - - - - - - + + + + - + - - + + - - - - - - - + + + + + + + - - - + + + + + + + - - - - - - + + + + + + - - + + diff --git a/devices/stm32/stm32g4-31_41.xml b/devices/stm32/stm32g4-31_41.xml index fb3eb6ec..4d1ed14c 100644 --- a/devices/stm32/stm32g4-31_41.xml +++ b/devices/stm32/stm32g4-31_41.xml @@ -159,27 +159,24 @@ - - + + - - - - + + + + - - - + - - - + + - + @@ -201,86 +198,84 @@ - - - - - + + + - - + + - - - + - + - + - - - + + + - + - - - - - - - - - - + + + + - - + + - - + + - - - - - - + + + + + + + + + + - + - + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32g4-71_91_a1.xml b/devices/stm32/stm32g4-71_91_a1.xml index 57fb48fe..9309721e 100644 --- a/devices/stm32/stm32g4-71_91_a1.xml +++ b/devices/stm32/stm32g4-71_91_a1.xml @@ -156,29 +156,26 @@ - - - + + + - - - - + + + + - - - + - - - + + - - + + @@ -200,95 +197,93 @@ - - - - - - + + + + - - + + - - - + - + - + - - - - + + + + - + - + - - - - - - - - - - - + + + + + - - - + + + - - + + - - - - - - - + + + + + + + + + + + - - + + - + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32g4-73_83.xml b/devices/stm32/stm32g4-73_83.xml index 6ab10ae3..66deaf44 100644 --- a/devices/stm32/stm32g4-73_83.xml +++ b/devices/stm32/stm32g4-73_83.xml @@ -186,37 +186,34 @@ - - - - - + + + + + - - - - - - - + + + + + + + - - - + - - - - - + + + + - - - + + + @@ -239,97 +236,95 @@ - - - - - - + + + + - - + + - - - + - + - + - - - - - - + + + + + + - + - + - - - - - - - - - - - + + + + + - - - + + + - - + + - - - - - - - + + + + + + + + + + + - - + + - + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32g4-74_84.xml b/devices/stm32/stm32g4-74_84.xml index 336083ac..0ea2304c 100644 --- a/devices/stm32/stm32g4-74_84.xml +++ b/devices/stm32/stm32g4-74_84.xml @@ -200,37 +200,34 @@ - - - - - + + + + + - - - - - - - + + + + + + + - - - + - - - - - + + + + - - - + + + @@ -253,100 +250,98 @@ - + - - - - - - + + + + - - + + - - - + - + - + - - - - - - + + + + + + - + - + - - - - - - - - - - - + + + + + - - - + + + - - + + - - - - - - - + + + + + + + + + + + - - + + - + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32h7-23_33.xml b/devices/stm32/stm32h7-23_33.xml index 8e0da70f..31576605 100644 --- a/devices/stm32/stm32h7-23_33.xml +++ b/devices/stm32/stm32h7-23_33.xml @@ -169,37 +169,33 @@ - - - + + + - - + + - - - - + - - + - + - - - + + + @@ -227,50 +223,48 @@ - - - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - - + + @@ -278,76 +272,84 @@ - - + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-25_35.xml b/devices/stm32/stm32h7-25_35.xml index aebb7279..3ae23ed8 100644 --- a/devices/stm32/stm32h7-25_35.xml +++ b/devices/stm32/stm32h7-25_35.xml @@ -196,37 +196,33 @@ - - - + + + - - + + - - - - + - - + - + - - - + + + @@ -254,50 +250,48 @@ - - - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - - + + @@ -305,79 +299,87 @@ - - + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-30.xml b/devices/stm32/stm32h7-30.xml index 61a18d4c..02fe0171 100644 --- a/devices/stm32/stm32h7-30.xml +++ b/devices/stm32/stm32h7-30.xml @@ -162,37 +162,33 @@ - - - + + + - - + + - - - - + - - + - + - - - + + + @@ -220,50 +216,48 @@ - - - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - - + + @@ -271,76 +265,84 @@ - - + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-42.xml b/devices/stm32/stm32h7-42.xml index abe96527..babdd0cc 100644 --- a/devices/stm32/stm32h7-42.xml +++ b/devices/stm32/stm32h7-42.xml @@ -167,33 +167,29 @@ - - - + + + - - - - - - + + + - - + - + - - + + @@ -220,36 +216,34 @@ - - - - - - + + + + - - - + + + - + - - - - - + + + + + - + - - + + @@ -257,73 +251,81 @@ - - - - + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-43_53.xml b/devices/stm32/stm32h7-43_53.xml index 74ea80c1..e92b0178 100644 --- a/devices/stm32/stm32h7-43_53.xml +++ b/devices/stm32/stm32h7-43_53.xml @@ -181,34 +181,30 @@ - - - + + + - - - - - - + + + - - + - + - - + + @@ -236,38 +232,36 @@ - - - - - - + + + + - - - + + + - + - - - - - + + + + + - + - - + + @@ -275,73 +269,81 @@ - - - - + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-45_55.xml b/devices/stm32/stm32h7-45_55.xml index 2998a386..a32d3c92 100644 --- a/devices/stm32/stm32h7-45_55.xml +++ b/devices/stm32/stm32h7-45_55.xml @@ -197,35 +197,31 @@ - - - + + + - - + + - - - - + - - + - + - - + + @@ -253,43 +249,41 @@ - - - - - - + + + + - - - + + + - - + + - - - - - + + + + + - + - - + + - - + + @@ -298,75 +292,83 @@ - - - - + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - + + - - + + diff --git a/devices/stm32/stm32h7-47_57.xml b/devices/stm32/stm32h7-47_57.xml index 28dadcc7..34ed8155 100644 --- a/devices/stm32/stm32h7-47_57.xml +++ b/devices/stm32/stm32h7-47_57.xml @@ -177,36 +177,32 @@ - - - + + + - - + + - - - - + - - + - + - - + + @@ -234,43 +230,41 @@ - - - - - - + + + + - - - + + + - - + + - - - - - + + + + + - + - - + + - - + + @@ -279,75 +273,83 @@ - - - - + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - - + + - - + + diff --git a/devices/stm32/stm32h7-50.xml b/devices/stm32/stm32h7-50.xml index 0b7ef591..bd67769c 100644 --- a/devices/stm32/stm32h7-50.xml +++ b/devices/stm32/stm32h7-50.xml @@ -160,34 +160,30 @@ - - - + + + - - - - - - + + + - - + - + - - + + @@ -215,38 +211,36 @@ - - - - - - + + + + - - - + + + - + - - - - - + + + + + - + - - + + @@ -254,73 +248,81 @@ - - - - + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + - - - - + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-a3.xml b/devices/stm32/stm32h7-a3.xml index 05cc50a9..171448de 100644 --- a/devices/stm32/stm32h7-a3.xml +++ b/devices/stm32/stm32h7-a3.xml @@ -180,35 +180,31 @@ - - + + - - - - - - + + + - - - + + - - + + - - + + @@ -235,42 +231,40 @@ - - - - - - + + + + - - - - + + + + - + - - - + + + - + - - + + - - + + @@ -278,12 +272,12 @@ - - + + - - + + @@ -293,67 +287,75 @@ - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-b0.xml b/devices/stm32/stm32h7-b0.xml index e2a26105..65ab213d 100644 --- a/devices/stm32/stm32h7-b0.xml +++ b/devices/stm32/stm32h7-b0.xml @@ -159,36 +159,32 @@ - - + + - - - - - - + + + - - - + + - - + + - - + + @@ -216,46 +212,44 @@ - - - - - - + + + + - - - - + + + + - + - - - + + + - + - - + + - - + + - - + + @@ -263,70 +257,78 @@ - - + + - - + + - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32h7-b3.xml b/devices/stm32/stm32h7-b3.xml index 289eccea..6f179c90 100644 --- a/devices/stm32/stm32h7-b3.xml +++ b/devices/stm32/stm32h7-b3.xml @@ -170,36 +170,32 @@ - - + + - - - - - - + + + - - - + + - - + + - - + + @@ -227,47 +223,45 @@ - - - - - - + + + + - - - - + + + + - + - - - + + + - + - - + + - - + + - - - + + + @@ -275,12 +269,12 @@ - - + + - - + + @@ -290,67 +284,75 @@ - - - - - - + + + + + + - - - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - + + diff --git a/devices/stm32/stm32l0-10.xml b/devices/stm32/stm32l0-10.xml index 99fbd197..a042ed84 100644 --- a/devices/stm32/stm32l0-10.xml +++ b/devices/stm32/stm32l0-10.xml @@ -41,11 +41,7 @@ - - - - - + @@ -61,44 +57,44 @@ - - - + - + - + - + - + - - - - + + - + - - + + - + + + + + - + diff --git a/devices/stm32/stm32l0-11_21.xml b/devices/stm32/stm32l0-11_21.xml index 2c00e244..e37cca54 100644 --- a/devices/stm32/stm32l0-11_21.xml +++ b/devices/stm32/stm32l0-11_21.xml @@ -69,15 +69,11 @@ - - - - - + - - + + @@ -94,37 +90,37 @@ - - - + - + - + - - - - + + - + - + - + + + + + - + diff --git a/devices/stm32/stm32l0-31_41.xml b/devices/stm32/stm32l0-31_41.xml index 5d3a8f45..11f8cca6 100644 --- a/devices/stm32/stm32l0-31_41.xml +++ b/devices/stm32/stm32l0-31_41.xml @@ -79,15 +79,11 @@ - - - - - + - - + + @@ -104,38 +100,38 @@ - - - + - + - + - - - - + + - + - - + + - + + + + + - + diff --git a/devices/stm32/stm32l0-51_52_53_62_63.xml b/devices/stm32/stm32l0-51_52_53_62_63.xml index fdbbbe30..eb6f04d4 100644 --- a/devices/stm32/stm32l0-51_52_53_62_63.xml +++ b/devices/stm32/stm32l0-51_52_53_62_63.xml @@ -115,20 +115,14 @@ - - - - - + - - + + - - - + @@ -143,51 +137,51 @@ - - - - + + - + - + - + - - - - - + + + - + - + - - + + - - + + + + + + - + diff --git a/devices/stm32/stm32l0-71_72_73_81_82_83.xml b/devices/stm32/stm32l0-71_72_73_81_82_83.xml index e5cf191a..a92243bc 100644 --- a/devices/stm32/stm32l0-71_72_73_81_82_83.xml +++ b/devices/stm32/stm32l0-71_72_73_81_82_83.xml @@ -205,20 +205,14 @@ - - - - - + - - + + - - - + @@ -233,59 +227,59 @@ - - - - - + + + - + - + - + - - - - - + + + - - + + - - + + - - + + - - - - - - - + + + + + + + + + + + - + diff --git a/devices/stm32/stm32l1-00.xml b/devices/stm32/stm32l1-00.xml index 84cd1914..c49b91f8 100644 --- a/devices/stm32/stm32l1-00.xml +++ b/devices/stm32/stm32l1-00.xml @@ -77,21 +77,19 @@ - - + + - - + + - - + + - - - + @@ -109,47 +107,47 @@ - - + + - - + + - - - - - - + + + + - - + + - - - - - - + + + + + + - - - + + + + + - - + + diff --git a/devices/stm32/stm32l1-51_52-6_8_b.xml b/devices/stm32/stm32l1-51_52-6_8_b.xml index 2906dba7..0fe45af2 100644 --- a/devices/stm32/stm32l1-51_52-6_8_b.xml +++ b/devices/stm32/stm32l1-51_52-6_8_b.xml @@ -126,17 +126,15 @@ - - + + - - + + - - - + @@ -152,42 +150,42 @@ - - + + - - - - - + + + - - + + - - - - - - + + + + + + - - - + + + + + - + diff --git a/devices/stm32/stm32l1-51_52_62-c_d_e.xml b/devices/stm32/stm32l1-51_52_62-c_d_e.xml index 39ede923..7d2567cc 100644 --- a/devices/stm32/stm32l1-51_52_62-c_d_e.xml +++ b/devices/stm32/stm32l1-51_52_62-c_d_e.xml @@ -144,13 +144,11 @@ - - + + - - - + @@ -167,59 +165,61 @@ - - + + - - + + - - - + + + - - - - - - + + + + - - + + - - - - - - - + + + + + + + - - + + + + - - - + + + + + - - + + diff --git a/devices/stm32/stm32l4-12_22.xml b/devices/stm32/stm32l4-12_22.xml index 27c8f1b2..f5c0c6ee 100644 --- a/devices/stm32/stm32l4-12_22.xml +++ b/devices/stm32/stm32l4-12_22.xml @@ -105,12 +105,12 @@ - - + + - + @@ -129,23 +129,21 @@ - - - - - + + + - - + + - + - + @@ -154,35 +152,36 @@ - - - - - - + + + - + - + - - - + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-31_33_43.xml b/devices/stm32/stm32l4-31_33_43.xml index 2a289e7b..4d678e86 100644 --- a/devices/stm32/stm32l4-31_33_43.xml +++ b/devices/stm32/stm32l4-31_33_43.xml @@ -154,21 +154,19 @@ - + - - + - - + + - - + @@ -186,72 +184,71 @@ - - - - - + + + - - + + - + - + - + - + - - - - + + + - - - - + + - + - - + + - - - + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-32_42.xml b/devices/stm32/stm32l4-32_42.xml index 7f0b2f0d..38d53961 100644 --- a/devices/stm32/stm32l4-32_42.xml +++ b/devices/stm32/stm32l4-32_42.xml @@ -72,21 +72,19 @@ - + - - + - - + + - - + @@ -104,65 +102,64 @@ - - - - + + - - + + - + - + - + - - - + + - - - - + + - + - - + + - - - + + + - - + + + + + + - - + + diff --git a/devices/stm32/stm32l4-51_71.xml b/devices/stm32/stm32l4-51_71.xml index 437e3d2f..10919081 100644 --- a/devices/stm32/stm32l4-51_71.xml +++ b/devices/stm32/stm32l4-51_71.xml @@ -132,29 +132,27 @@ - - - + + + - - + - - + + - - + + - - + - + @@ -173,25 +171,23 @@ - - - - - - + + + + - - + + - + - - + + @@ -199,57 +195,62 @@ - - + + - + - - - - + + + - - - - + + - - + + - - + + - - - - - - - + + + + + + + - - + + + + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-52_62.xml b/devices/stm32/stm32l4-52_62.xml index a526d8de..8bb8d9e5 100644 --- a/devices/stm32/stm32l4-52_62.xml +++ b/devices/stm32/stm32l4-52_62.xml @@ -121,24 +121,22 @@ - + - - + - - + + - - + - + @@ -156,72 +154,75 @@ - - - - - - + + + + - - + + - + - + - + - + - - - - - - - + + + + - + - + - - - - + + + + - + + + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-75_85.xml b/devices/stm32/stm32l4-75_85.xml index ba97d256..d89c994d 100644 --- a/devices/stm32/stm32l4-75_85.xml +++ b/devices/stm32/stm32l4-75_85.xml @@ -103,26 +103,24 @@ - - - + + + - - + - - + + - - + - + @@ -141,82 +139,85 @@ - - - - - + + + - - + + - + - - + + - - + + - + - - - - + + + - - - - + + - - + + - - + + - - - - - - - + + + + + + + - - + + + + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-76_86.xml b/devices/stm32/stm32l4-76_86.xml index a972190d..6bebfc2c 100644 --- a/devices/stm32/stm32l4-76_86.xml +++ b/devices/stm32/stm32l4-76_86.xml @@ -136,26 +136,24 @@ - - - + + + - - + - - + + - - + - + @@ -174,83 +172,86 @@ - - - - - + + + - - + + - + - - + + - - + + - + - - - - + + + - - - - + + - - + + - - + + - - - - - - - + + + + + + + - - + + + + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-96_a6.xml b/devices/stm32/stm32l4-96_a6.xml index 4c5b3462..05d53e7c 100644 --- a/devices/stm32/stm32l4-96_a6.xml +++ b/devices/stm32/stm32l4-96_a6.xml @@ -164,28 +164,26 @@ - - - + + + - - - + + - - + + - - + - + @@ -206,93 +204,96 @@ - - - - - - + + + + - - + + - + - - + + - - + + - + - + - + - + - - - - + + + - - - - + + - - + + - - + + - - - - - - - + + + + + + + - - + + + + + + - - - + + + + + + + - - + + diff --git a/devices/stm32/stm32l4-p5.xml b/devices/stm32/stm32l4-p5.xml index 35ab3f46..15382564 100644 --- a/devices/stm32/stm32l4-p5.xml +++ b/devices/stm32/stm32l4-p5.xml @@ -122,25 +122,23 @@ - - + + - - + - - + + - - + - + @@ -160,89 +158,92 @@ - - - - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - - - - - + + + + - - + + - - + + - - - - - - - + + + + + + + + + + + - - + + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32l4-q5.xml b/devices/stm32/stm32l4-q5.xml index e9c7d486..0b888c48 100644 --- a/devices/stm32/stm32l4-q5.xml +++ b/devices/stm32/stm32l4-q5.xml @@ -106,26 +106,24 @@ - - + + - - + - - + + - - + - + @@ -145,31 +143,29 @@ - - - - - - + + + + - - + + - + - - + + - - + + @@ -177,58 +173,63 @@ - - + + - - + + - - - - - - - + + + + - - + + - - + + - - - - - - - + + + + + + + + + + + - - + + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32l4-r5_r7_r9.xml b/devices/stm32/stm32l4-r5_r7_r9.xml index d00ed20f..972a86e1 100644 --- a/devices/stm32/stm32l4-r5_r7_r9.xml +++ b/devices/stm32/stm32l4-r5_r7_r9.xml @@ -125,24 +125,22 @@ - + - - + - - + + - - + - + @@ -163,87 +161,90 @@ - - - - - - + + + + - - + + - + - - + + - - + + - - + + - + - - - - - - - + + + + - - + + - - + + - - - - - - - + + + + + + + + + + + - - + + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32l4-s5_s7_s9.xml b/devices/stm32/stm32l4-s5_s7_s9.xml index ff4dd974..e2a222d4 100644 --- a/devices/stm32/stm32l4-s5_s7_s9.xml +++ b/devices/stm32/stm32l4-s5_s7_s9.xml @@ -117,25 +117,23 @@ - + - - + - - + + - - + - + @@ -157,87 +155,90 @@ - - - - - - + + + + - - + + - + - - + + - - + + - - + + - + - - - - - - - + + + + - - + + - - + + - - - - - - - + + + + + + + + + + + - - + + + + + + - - - + + + - - + + diff --git a/devices/stm32/stm32wb-30_50.xml b/devices/stm32/stm32wb-30_50.xml index c744be5b..fd0e203b 100644 --- a/devices/stm32/stm32wb-30_50.xml +++ b/devices/stm32/stm32wb-30_50.xml @@ -58,10 +58,10 @@ - + - + @@ -79,17 +79,13 @@ - - - + - - - + - - + + @@ -100,33 +96,31 @@ - - + - - - - - - + - + - - - + + + + + + + - + - - + + diff --git a/devices/stm32/stm32wb-35_55.xml b/devices/stm32/stm32wb-35_55.xml index 2777f9c6..01134b1d 100644 --- a/devices/stm32/stm32wb-35_55.xml +++ b/devices/stm32/stm32wb-35_55.xml @@ -110,15 +110,15 @@ - + - - + + - - + + @@ -136,22 +136,18 @@ - - - - + + - - - + - - + + - + @@ -160,42 +156,40 @@ - + - - - + + - - - - - - + - + - - - + + + + + + + - + - - + + diff --git a/devices/stm32/stm32wb-5m.xml b/devices/stm32/stm32wb-5m.xml index 818e9e6f..135e3aab 100644 --- a/devices/stm32/stm32wb-5m.xml +++ b/devices/stm32/stm32wb-5m.xml @@ -72,15 +72,15 @@ - + - - + + - - + + @@ -98,22 +98,18 @@ - - - - + + - - - + - - + + - + @@ -122,42 +118,40 @@ - + - - - + + - - - - - - + - + - - - + + + + + + + - + - - + + diff --git a/tools/generator/dfg/avr/avr_device_tree.py b/tools/generator/dfg/avr/avr_device_tree.py index 488f26a6..ccb0305c 100644 --- a/tools/generator/dfg/avr/avr_device_tree.py +++ b/tools/generator/dfg/avr/avr_device_tree.py @@ -237,10 +237,10 @@ def driverOrder(e): driver.setAttributes("name", dtype, "type", compatible) # Add all instances to this driver if any(i != dtype for i in instances): - driver.addSortKey(lambda e: e["value"]) + driver.addSortKey(lambda e: e["name"]) for i in instances: inst = driver.addChild("instance") - inst.setValue(i[len(dtype):]) + inst.setAttribute("name", i[len(dtype):]) # GPIO driver gpio_driver = tree.addChild("driver") diff --git a/tools/generator/dfg/nrf/nrf_device_tree.py b/tools/generator/dfg/nrf/nrf_device_tree.py index 37f00a6a..a438758f 100644 --- a/tools/generator/dfg/nrf/nrf_device_tree.py +++ b/tools/generator/dfg/nrf/nrf_device_tree.py @@ -243,10 +243,10 @@ def driverOrder(e): driver.setAttributes('name', dtype, 'type', compatible) # Add all instances to this driver if any(i != dtype for i in instances): - driver.addSortKey(lambda e: e['value']) + driver.addSortKey(lambda e: e['name']) for i in instances: inst = driver.addChild('instance') - inst.setValue(i[len(dtype):]) + inst.setAttribute("name", i[len(dtype):]) # GPIO driver gpio_driver = tree.addChild('driver') diff --git a/tools/generator/dfg/sam/sam_device_tree.py b/tools/generator/dfg/sam/sam_device_tree.py index aed4ea7a..24e001c7 100644 --- a/tools/generator/dfg/sam/sam_device_tree.py +++ b/tools/generator/dfg/sam/sam_device_tree.py @@ -226,10 +226,10 @@ def driverOrder(e): driver.setAttributes("name", dtype, "type", compatible) # Add all instances to this driver if any(i != dtype for i in instances): - driver.addSortKey(lambda e: e["value"]) + driver.addSortKey(lambda e: e["name"]) for i in instances: inst = driver.addChild("instance") - inst.setValue(i[len(dtype):]) + inst.setAttribute("name", i[len(dtype):]) # GPIO driver gpio_driver = tree.addChild("driver") diff --git a/tools/generator/dfg/stm32/stm_device_tree.py b/tools/generator/dfg/stm32/stm_device_tree.py index 77ac3829..239c4fed 100644 --- a/tools/generator/dfg/stm32/stm_device_tree.py +++ b/tools/generator/dfg/stm32/stm_device_tree.py @@ -154,7 +154,7 @@ def clean_up_version(version): modules.append(tuple([m.lower() for m in module])) modules.append( ("flash", "flash", "v1.0")) - modules = [m + stm_peripherals.getPeripheralData(did, m) for m in modules] + modules = [m + stm_peripherals.getPeripheralData(did, m, stm_header) for m in modules] p["modules"] = modules LOGGER.debug("Available Modules are:\n" + STMDeviceTree._modulesToString(modules)) @@ -347,10 +347,10 @@ def rv(param, default=[]): else: allSignals = gpioFile.compactQuery('//GPIO_Pin[@Name="{}"]/PinSignal/SpecificParameter[@Name="GPIO_AF"]/..'.format(rname)) signalMap = { a.get("Name"): a[0][0].text.lower().replace("gpio_af", "")[:2].replace("_", "") for a in allSignals } - altFunctions = [ (s.lower(), (signalMap[s] if s in signalMap else "-1")) for s in localSignals ] + altFunctions = [ (s.lower(), signalMap.get(s, "-1")) for s in localSignals ] afs = [] - for af in altFunctions: + for af in set(altFunctions): for raf in split_multi_af(af[0]): naf = {} naf["driver"], naf["instance"], naf["name"] = raf @@ -411,7 +411,7 @@ def _modulesToString(modules): string = "" mods = sorted(modules) char = mods[0][0][0:1] - for _, instance, _, _, _, _ in mods: + for _, instance, _, _, _ in mods: if not instance.startswith(char): string += "\n" string += instance + " \t" @@ -460,18 +460,29 @@ def driverOrder(e): STMDeviceTree.addMemoryToNode(p, core_child) STMDeviceTree.addInterruptTableToNode(p, core_child) - modules = {} - for m, i, _, h, f, pr in p["modules"]: + raw_modules = {} + # Group modules by name + for m, i, _, h, f in p["modules"]: # if m in ["fatfs", "freertos"]: continue; - if m+h not in modules: - modules[m+h] = (m, h, f, pr, [i]) + if m+h not in raw_modules: + raw_modules[m+h] = (m, h, [(i, f)]) else: - if (modules[m+h][1] != h): - print(modules[m+h], "<-", (m, h, f, pr, i)) - modules[m+h][4].append(i) + if (raw_modules[m+h][1] != h): + print(raw_modules[m+h], "<-", (m, h, i, f)) + raw_modules[m+h][2].append( (i, f) ) + # Pull out shared instance features + modules = {} + for (mid, (name, hardware, instances)) in raw_modules.items(): + shared = defaultdict(int) + for (_, features) in instances: + for f in features: + shared[f] += 1 + shared = [f for (f, count) in shared.items() if count == len(instances)] + instances = [(i, [f for f in features if f not in shared]) for (i, features) in instances] + modules[mid] = (name, hardware, shared, instances) # add all other modules - for name, hardware, features, protocols, instances in modules.values(): + for name, hardware, shared_features, instances in modules.values(): driver = tree.addChild("driver") driver.setAttributes("name", name, "type", hardware) if name == "gpio": @@ -482,24 +493,26 @@ def driver_sort_key(e): if e.name == "feature": return (0, 0, e.get("value", "AAA")) if e.name == "instance": - if e["value"].isdigit(): - return (1, int(e["value"]), "") - return (1, 0, e["value"]) + if e.get("name", "a").isdigit(): + return (1, int(e["name"]), "") + return (1, 0, e["name"]) return (1e6, 1e6, 1e6) driver.addSortKey(driver_sort_key) - for f in features: + # + for f in shared_features: feat = driver.addChild("feature") feat.setValue(f) - # for pr in protocols: - # prot = driver.addChild("protocol") - # prot.setValue(pr) # Add all instances to this driver - if any(i != name for i in instances): - for i in instances: + if any(i[0] != name for i in instances): + for (instance, features) in instances: inst = driver.addChild("instance") - iname = i[len(name):] + inst.addSortKey(lambda e: e["value"]) + iname = instance[len(name):] iname = iname.replace("_m", "cortex-m") - inst.setValue(iname) + inst.setAttribute("name", iname) + for f in features: + feat = inst.addChild("feature") + feat.setValue(f) if name == "flash": flv = p["flash_latency"] diff --git a/tools/generator/dfg/stm32/stm_header.py b/tools/generator/dfg/stm32/stm_header.py index 1e29adf7..babfc843 100644 --- a/tools/generator/dfg/stm32/stm_header.py +++ b/tools/generator/dfg/stm32/stm_header.py @@ -86,6 +86,11 @@ def get_defines(self): STMHeader.CACHE_HEADER[self.header_file]["defines"] = self._get_defines() return STMHeader.CACHE_HEADER[self.header_file]["defines"] + def get_filtered_defines(self): + if "filtered_defines" not in STMHeader.CACHE_HEADER[self.header_file]: + STMHeader.CACHE_HEADER[self.header_file]["filtered_defines"] = self._get_filtered_defines() + return STMHeader.CACHE_HEADER[self.header_file]["filtered_defines"] + def get_memory_map(self): if "memmap" not in STMHeader.CACHE_HEADER[self.header_file]: STMHeader.CACHE_HEADER[self.header_file]["memmap"] = self._get_memmap() @@ -128,7 +133,7 @@ def _get_defines(self): # create the destination directory destination = (STMHeader.CACHE_PATH / self.family_folder / self.header_file).with_suffix(".cpp").absolute() executable = destination.with_suffix("") - defines = self._get_filtered_defines() + defines = self.get_filtered_defines() if not executable.exists(): # generate the cpp file from the template LOGGER.info("Generating {} ...".format(destination.name)) diff --git a/tools/generator/dfg/stm32/stm_peripherals.py b/tools/generator/dfg/stm32/stm_peripherals.py index 19e1ecd3..8bb8136f 100644 --- a/tools/generator/dfg/stm32/stm_peripherals.py +++ b/tools/generator/dfg/stm32/stm_peripherals.py @@ -12,38 +12,31 @@ { 'hardware': 'stm32-f0', 'features': [], - 'protocols': ['analog-in'], 'devices': [{'family': ['f0']}] },{ 'hardware': 'stm32-l0', 'features': ['oversampler', 'calfact', 'prescaler'], - 'protocols': ['analog-in'], 'devices': [{'family': ['l0']}] },{ 'hardware': 'stm32-g0', 'features': ['oversampler', 'calfact', 'prescaler'], - 'protocols': ['analog-in'], 'devices': [{'family': ['g0']}] },{ # F373 & F378 has a non-special ADC 'hardware': 'stm32', 'features': [], - 'protocols': ['analog-in'], 'devices': [{'family': ['f3'], 'name': ['73', '78']}] },{ 'hardware': 'stm32-f3', 'features': [], - 'protocols': ['analog-in'], 'devices': [{'family': ['f3', 'l4', 'g4', 'wb']}] },{ 'hardware': 'stm32-h7', 'features': [], - 'protocols': ['analog-in'], 'devices': [{'family': ['h7']}] },{ 'hardware': 'stm32', 'features': [], - 'protocols': ['analog-in'], 'devices': '*' } ] @@ -54,7 +47,6 @@ { 'hardware': 'stm32-f3', 'features': [], - 'protocols': ['analog-in'], 'devices': [{'family': ['f3']}] } ] @@ -66,13 +58,11 @@ # 14 shared filters 'hardware': 'stm32', 'features': ['filter-14'], - 'protocols': ['can-v2.0a', 'can-v2.0b'], 'devices': [{'family': ['f0', 'g0', 'f1']}] },{ # 28 shared filters 'hardware': 'stm32', 'features': ['filter-28'], - 'protocols': ['can-v2.0a', 'can-v2.0b'], 'devices': '*' } ] @@ -83,7 +73,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -95,19 +84,16 @@ # Custom polynomial and reverse data 'hardware': 'stm32', 'features': ['polynomial', 'reverse'], - 'protocols': ['crc32'], 'devices': [{'family': ['f0', 'f3', 'f7', 'h7']}] },{ # Custom polynomial and reverse data 'hardware': 'stm32', 'features': ['reverse'], - 'protocols': ['crc32'], 'devices': [{'family': ['g0', 'g4']}] },{ # no poly size 'hardware': 'stm32', 'features': [], - 'protocols': ['crc32'], 'devices': '*' } ] @@ -118,25 +104,21 @@ { 'hardware': 'stm32-mux', 'features': [], - 'protocols': ['mem2mem', 'mem2per', 'per2per'], 'devices': [{'family': ['h7', 'g0', 'g4', 'wb']}, {'family': ['l4'], 'name': ['p5', 'p7', 'p9', 'q5', 'q7', 'q9', 'r5', 'r7', 'r9', 's5', 's7', 's9']}] }, { 'hardware': 'stm32-stream-channel', 'features': [], - 'protocols': ['mem2mem', 'mem2per', 'per2per'], 'devices': [{'family': ['f2', 'f4', 'f7']}] }, { 'hardware': 'stm32-channel-request', 'features': [], - 'protocols': ['mem2mem', 'mem2per', 'per2per'], 'devices': [{'family': ['l0', 'l4']}, {'family': ['f0'], 'name': ['91', '98']}, {'family': ['f0'], 'name': ['30'], 'size': ['c']}] }, { 'hardware': 'stm32-channel', 'features': [], - 'protocols': ['mem2mem', 'mem2per', 'per2per'], 'devices': '*' } ] @@ -147,12 +129,10 @@ { 'hardware': 'stm32', 'features': ['window'], - 'protocols': [], 'devices': [{'family': ['f0', 'f3', 'f7', 'g0', 'g4', 'wb']}] },{ 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -162,13 +142,7 @@ 'groups': [ { 'hardware': 'stm32', - 'features': ['data-size', 'nss-pulse', 'fifo'], - 'protocols': [], - 'devices': [{'family': ['f0', 'g0', 'f3', 'f7', 'l4', 'g4', 'wb']}] - },{ - 'hardware': 'stm32', - 'features': [], - 'protocols': [], + 'features': {'data-size':'SPI_CR2_DS_3', 'fifo':'SPI_SR_FRLVL'}, 'devices': '*' } ] @@ -179,12 +153,10 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': [{'family': ['f1']}] },{ 'hardware': 'stm32', 'features': ['status'], - 'protocols': [], 'devices': '*' } ] @@ -195,7 +167,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -206,7 +177,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -217,7 +187,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -229,7 +198,6 @@ { 'hardware': 'stm32-advanced', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -239,7 +207,6 @@ { 'hardware': 'stm32-general-purpose', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -249,7 +216,6 @@ { 'hardware': 'stm32-general-purpose', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -259,7 +225,6 @@ { 'hardware': 'stm32-basic', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -272,32 +237,26 @@ # Registers are called AFIO, not SYS! 'hardware': 'stm32-f1', 'features': ['exti', 'remap'], - 'protocols': [], 'devices': [{'family': ['f1']}] },{ 'hardware': 'stm32', 'features': ['exti', 'fpu', 'ccm-wp', 'cfgr2'], - 'protocols': [], 'devices': [{'family': ['f3', 'g4']}] },{ 'hardware': 'stm32', 'features': ['exti', 'sram2-wp', 'cfgr2', 'imr'], - 'protocols': [], 'devices': [{'family': ['wb']}] },{ 'hardware': 'stm32', 'features': ['exti', 'cfgr2', 'itline'], - 'protocols': [], 'devices': [{'family': ['f0'], 'name': ['91', '98']}, {'family': ['g0']}] },{ 'hardware': 'stm32', 'features': ['exti', 'cfgr2'], - 'protocols': [], 'devices': [{'family': ['f0']}] },{ 'hardware': 'stm32', 'features': ['exti'], - 'protocols': [], 'devices': '*' } ] @@ -308,7 +267,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': ['2d', 'blitter'], 'devices': '*' } ] @@ -319,7 +277,6 @@ { 'hardware': 'stm32', 'features': [], - 'protocols': [], 'devices': '*' } ] @@ -333,12 +290,10 @@ # Some F4 have a digital noise filter 'hardware': 'stm32', 'features': ['dnf'], - 'protocols': ['i2c-v3.0', 'smb-v2.0', 'pmb-v1.1'], 'devices': [{'family': ['f4'], 'name': ['27', '29', '37', '39', '46', '69', '79']}] },{ 'hardware': 'stm32', 'features': [], - 'protocols': ['i2c-v3.0', 'smb-v2.0', 'pmb-v1.1'], 'devices': [{'family': ['f1', 'f2', 'f4', 'l1']}] } ] @@ -350,7 +305,6 @@ # This hardware supports neither FM+ (1 Mhz) nor SMBus 'hardware': 'stm32-extended', 'features': ['dnf'], - 'protocols': ['i2c-v3.0'], 'devices': [ { 'family': ['f0'], @@ -365,13 +319,11 @@ # This hardware supports FM+ (1 Mhz) but not SMBus 'hardware': 'stm32-extended', 'features': ['dnf', 'fmp'], - 'protocols': ['i2c-v3.0'], 'devices': [{'family': ['f0', 'g0', 'l0']}] },{ # This hardware supports FM+ (1 Mhz) and SMBus 'hardware': 'stm32-extended', 'features': ['dnf', 'fmp'], - 'protocols': ['i2c-v3.0', 'smb-v2.0', 'pmb-v1.1'], 'devices': [{'family': ['f3', 'f7', 'l4', 'h7', 'g4', 'wb']}] } ] @@ -383,7 +335,6 @@ # This hardware supports FM+ (1 Mhz) and SMBus 'hardware': 'stm32-extended', 'features': ['dnf', 'fmp'], - 'protocols': ['i2c-v3.0', 'smb-v2.0', 'pmb-v1.1'], 'devices': [{'family': ['f0', 'g0', 'f3', 'f7', 'l0', 'l4', 'h7', 'g4', 'wb']}] } ] @@ -394,28 +345,11 @@ 'groups': [ { 'hardware': 'stm32-extended', - 'features': ['wakeup'], - 'protocols': ['uart'], - 'devices': [{'family': ['f0', 'f3']}] - },{ - 'hardware': 'stm32-extended', - 'features': ['tcbgt'], - 'protocols': ['uart'], - 'devices': [{'family': ['l4'], 'name': ['p5', 'p7', 'p9', 'q5', 'q7', 'q9', 'r5', 'r7', 'r9', 's5', 's7', 's9']}, {'family': ['g0', 'g4', 'wb']}] - },{ - 'hardware': 'stm32-extended', - 'features': [], - 'protocols': ['uart'], - 'devices': [{'family': ['f7', 'l4']}] + 'features': {'swap': 'USART_CR2_SWAP', 'over8': 'USART_CR1_OVER8', 'half-duplex': 'USART_CR3_HDSEL', '7-bit': 'USART_CR1_M1', 'tcbgt': 'USART_CR1_RXNEIE_RXFNEIE'}, + 'devices': [{'family': ['f0', 'f3', 'f7', 'l4', 'g0', 'g4', 'wb']}] },{ 'hardware': 'stm32', - 'features': ['over8'], - 'protocols': ['uart'], - 'devices': [{'family': ['f2', 'f4']}] - },{ - 'hardware': 'stm32', - 'features': [], - 'protocols': ['uart'], + 'features': {'swap': 'USART_CR2_SWAP', 'over8': 'USART_CR1_OVER8', 'half-duplex': 'USART_CR3_HDSEL', '7-bit': 'USART_CR1_M1', 'tcbgt': 'USART_CR1_RXNEIE_RXFNEIE'}, 'devices': '*' } ] @@ -425,28 +359,11 @@ 'groups': [ { 'hardware': 'stm32-extended', - 'features': ['wakeup'], - 'protocols': ['uart', 'spi'], - 'devices': [{'family': ['f0', 'f3']}] - },{ - 'hardware': 'stm32-extended', - 'features': ['tcbgt'], - 'protocols': ['uart', 'spi'], - 'devices': [{'family': ['l4'], 'name': ['p5', 'p7', 'p9', 'q5', 'q7', 'q9', 'r5', 'r7', 'r9', 's5', 's7', 's9']}, {'family': ['g0', 'g4', 'wb']}] - },{ - 'hardware': 'stm32-extended', - 'features': [], - 'protocols': ['uart', 'spi'], - 'devices': [{'family': ['f7', 'l4']}] + 'features': {'swap': 'USART_CR2_SWAP', 'over8': 'USART_CR1_OVER8', 'half-duplex': 'USART_CR3_HDSEL', '7-bit': 'USART_CR1_M1', 'tcbgt': 'USART_CR1_RXNEIE_RXFNEIE'}, + 'devices': [{'family': ['f0', 'f3', 'f7', 'l4', 'g0', 'g4', 'wb']}] },{ 'hardware': 'stm32', - 'features': ['over8'], - 'protocols': ['uart', 'spi'], - 'devices': [{'family': ['f2', 'f4']}] - },{ - 'hardware': 'stm32', - 'features': [], - 'protocols': ['uart', 'spi'], + 'features': {'swap': 'USART_CR2_SWAP', 'over8': 'USART_CR1_OVER8', 'half-duplex': 'USART_CR3_HDSEL', '7-bit': 'USART_CR1_M1', 'tcbgt': 'USART_CR1_RXNEIE_RXFNEIE'}, 'devices': '*' } ] @@ -458,26 +375,37 @@ # The F1 remaps groups of pins 'hardware': 'stm32-f1', 'features': [], - 'protocols': ['digital-in', 'digital-out', 'open-drain', 'exti'], 'devices': [{'family': ['f1']}] },{ # The rest remaps pins individually 'hardware': 'stm32', 'features': [], - 'protocols': ['digital-in', 'digital-out', 'open-drain', 'exti'], 'devices': '*' } ] }] } -def getPeripheralData(did, module): +def resolvePeripheralFeatures(header, feature_map, module): + if isinstance(feature_map, list): + return [] + + name, instance, version = module + features = set() + for feature, registers in feature_map.items(): + if not isinstance(registers, list): registers = [registers]; + if any(r.format(n=name, i=instance) in header.get_filtered_defines() for r in registers): + features.add(feature) + + return list(features) + +def getPeripheralData(did, module, header): name, inst, version = module if name in stm_peripherals: for instance_list in stm_peripherals[name]: if instance_list['instances'] == '*' or inst[len(name):] in instance_list['instances']: for group in instance_list['groups']: if group['devices'] == '*' or DeviceMerger._get_index_for_id(group['devices'], did) >= 0: - return (group['hardware'], group['features'], group['protocols']) + return (group['hardware'], resolvePeripheralFeatures(header, group['features'], module)) - return ('stm32-' + version, [], []) + return ('stm32-' + version, []) From 3729b812b494893042e821424c2cd533e65abfd9 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Sun, 21 Feb 2021 01:31:50 +0100 Subject: [PATCH 5/5] [api] Move GPIO code from modm to here --- modm_devices/__init__.py | 10 ++- modm_devices/cache.py | 17 ++++ modm_devices/device.py | 78 +++++++++--------- modm_devices/device_file.py | 11 ++- modm_devices/driver.py | 44 ++++++++++ modm_devices/stm32/__init__.py | 1 + modm_devices/stm32/core.py | 54 +++++++++++++ modm_devices/stm32/device.py | 54 +++++++++++++ modm_devices/stm32/flash.py | 24 ++++++ modm_devices/stm32/gpio.py | 142 +++++++++++++++++++++++++++++++++ 10 files changed, 395 insertions(+), 40 deletions(-) create mode 100644 modm_devices/cache.py create mode 100644 modm_devices/driver.py create mode 100644 modm_devices/stm32/__init__.py create mode 100644 modm_devices/stm32/core.py create mode 100644 modm_devices/stm32/device.py create mode 100644 modm_devices/stm32/flash.py create mode 100644 modm_devices/stm32/gpio.py diff --git a/modm_devices/__init__.py b/modm_devices/__init__.py index 994e8fcf..26bff962 100644 --- a/modm_devices/__init__.py +++ b/modm_devices/__init__.py @@ -10,10 +10,18 @@ from . import device_identifier from . import device from . import parser +from . import stm32 from .pkg import naturalkey from .exception import ParserException -__all__ = ['exception', 'device_file', 'device_identifier', 'device', 'parser', 'pkg'] +__all__ = [ + 'exception', + 'device_file', + 'device_identifier', + 'device', + 'parser', + 'pkg' +] __version__ = "0.2.8" diff --git a/modm_devices/cache.py b/modm_devices/cache.py new file mode 100644 index 00000000..c1f2755d --- /dev/null +++ b/modm_devices/cache.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import functools + +class cached_property(object): + def __init__(self, func): + self.__doc__ = getattr(func, "__doc__") + self.func = func + + def __get__(self, obj, cls): + if obj is None: + return self + value = obj.__dict__[self.func.__name__] = self.func(obj) + return value + +cached_function = functools.lru_cache(None) diff --git a/modm_devices/device.py b/modm_devices/device.py index 845f69aa..62738e0e 100644 --- a/modm_devices/device.py +++ b/modm_devices/device.py @@ -10,63 +10,69 @@ from .exception import ParserException from .device_identifier import DeviceIdentifier - +from .driver import Driver +from .cache import * +import fnmatch class Device: def __init__(self, identifier: DeviceIdentifier, device_file): self._identifier = identifier.copy() - self.naming_schema = identifier.naming_schema self.partname = identifier.string - self.device_file = device_file - + self._device_file = device_file self.__properties = None @property def _properties(self): if self.__properties is None: - self.__properties = self.device_file.get_properties(self._identifier) + self.__properties = self._device_file.get_properties(self._identifier) return self.__properties - @property - def identifier(self): - return self._identifier - - def get_all_drivers(self, name): - parts = name.split(":") + def _find_drivers(self, *patterns): results = [] + for pattern in patterns: + parts = pattern.split(":") - if len(parts) == 1: - results = [d for d in self._properties["driver"] if d["name"] == parts[0]] - elif len(parts) == 2: - find_all = (parts[1][-1] == '*') - for driver in self._properties["driver"]: - if driver["name"] == parts[0] and \ - ((find_all and driver["type"].startswith(parts[1][:-1])) or - (not find_all and driver["type"] == parts[1])): - results.append(driver) - else: - raise ParserException("Invalid driver name '{}'. " - "The name must contain no or one ':' to " - "separate type and name.".format(name)) + if len(parts) == 1: + results.extend(d for d in self._properties["driver"] + if fnmatch.fnmatch(d["name"], parts[0])) + elif len(parts) == 2: + results.extend(d for d in self._properties["driver"] + if (fnmatch.fnmatch(d["name"], parts[0]) and + fnmatch.fnmatch(d["type"], parts[1]))) + else: + raise ParserException("Invalid driver pattern '{}'. " + "The name must contain no or one ':' to " + "separate `name:type` pattern.".format(parts)) return results - def get_driver(self, name): - results = self.get_all_drivers(name) + def _find_first_driver(self, *patterns): + results = self._find_drivers(*patterns) return results[0] if len(results) else None - def has_driver(self, name, type: list = []): - if len(type) == 0: - return self.get_driver(name) is not None + @property + def did(self): + return self._identifier + + @cached_function + def driver(self, name): + return Driver(self, self._find_first_driver(name)) + + def drivers(self, *names): + return [Driver(self, d) for d in self._find_drivers(*names)] - if ':' in name: - raise ParserException("Invalid driver name '{}'. " - "The name must contain no ':' when using the " - "compatible argument.".format(name)) + def has_driver(self, *names): + return len(self._find_drivers(*names)) - return any(self.get_driver(name + ':' + c) is not None for c in type) + # Deprecated stuff + def get_driver(self, pattern): + return self._find_first_driver(pattern) - def __str__(self): - return self.partname + def get_all_drivers(self, *patterns): + return self._find_drivers(*patterns) + + @property + def identifier(self): + return self.did diff --git a/modm_devices/device_file.py b/modm_devices/device_file.py index 68e8c9aa..b7d81f87 100644 --- a/modm_devices/device_file.py +++ b/modm_devices/device_file.py @@ -11,6 +11,7 @@ from collections import defaultdict from .device import Device +from .stm32.device import Stm32Device from .device_identifier import DeviceIdentifier from .device_identifier import MultiDeviceIdentifier from .access import read_only @@ -47,10 +48,14 @@ def get_devices(self): valid_devices = [node.text for node in device_node.iterfind(self._VALID_DEVICE)] devices = identifiers if len(invalid_devices): - devices = [did for did in devices if did.string not in invalid_devices] + devices = (did for did in devices if did.string not in invalid_devices) if len(valid_devices): - devices = [did for did in devices if did.string in valid_devices] - return [Device(did, self) for did in devices] + devices = (did for did in devices if did.string in valid_devices) + def build_device(did, device_file): + if did.platform == "stm32": + return Stm32Device(did, device_file) + return Device(did, device_file) + return [build_device(did, self) for did in devices] @staticmethod def is_valid(node, identifier: DeviceIdentifier): diff --git a/modm_devices/driver.py b/modm_devices/driver.py new file mode 100644 index 00000000..00aff210 --- /dev/null +++ b/modm_devices/driver.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2020, Niklas Hauser +# All rights reserved. + +from collections import defaultdict +from .cache import * + +class Instance: + def __init__(self, driver, instance): + self._instance = instance + self.driver = driver + self.name = self._instance["name"] + self.number = int(self.name) if self.name.isdigit() else self.name + + def features(self, default=[]): + feats = self.driver.features() + feats.extend(self._instance.get("feature", [])) + return feats if len(feats) else default + + def __str__(self): + return self.name + + +class Driver: + def __init__(self, device, driver): + self._driver = driver + self.device = device + self.name = self._driver["name"] + self.type = self._driver["type"] + + def instances(self, default=[]): + if "instance" in self._driver: + return [Instance(self, i) for i in self._driver["instance"]] + return default + + def features(self, default=[]): + if "feature" in self._driver: + return list(self._driver["feature"]) + return default + + def __str__(self): + return self.name diff --git a/modm_devices/stm32/__init__.py b/modm_devices/stm32/__init__.py new file mode 100644 index 00000000..d948faf5 --- /dev/null +++ b/modm_devices/stm32/__init__.py @@ -0,0 +1 @@ +from . import device diff --git a/modm_devices/stm32/core.py b/modm_devices/stm32/core.py new file mode 100644 index 00000000..4801a751 --- /dev/null +++ b/modm_devices/stm32/core.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2020, Niklas Hauser +# All rights reserved. + +from ..cache import cached_property +from ..driver import Driver +from collections import defaultdict + +class DriverCore(Driver): + def __init__(self, device): + Driver.__init__(self, device, device._find_first_driver("core")) + + + def vectors(self, filterfn=None): + vecs = (v["name"] for v in self._driver["vector"]) + if filterfn is not None: + vecs = filter(filterfn, vecs) + return vecs + + + def instance_irq_map(self, name): + """ + :return: a map from int(instance) to str(name) interrupt starting with {name}. + """ + vector_map = defaultdict(list) + for vector in self.vectors(lambda v: v.startswith(name)): + vrange = sorted(int(d) for d in vector[len(name):].split("_") if d.isdigit()) + if len(vrange) == 2: + vrange = list(range(vrange[0], vrange[1]+1)) + for num in vrange: + # if num in vector_map: + # raise ValueError("Instance '{}' already in '{}' map!".format(str(num), name)) + vector_map[num].append(vector) + return vector_map + + + def shared_irqs(self, name): + """ + :return: a map from str(name) to range(instances) >= 2 for interrupts starting with {name}. + """ + vector_range = {} + for vector in self.vectors(lambda v: v.startswith(name)): + vrange = sorted(int(d) for d in vector[len(name):].split("_") if d.isdigit()) + if len(vrange) <= 1: + continue; + if len(vrange) == 2: + vrange = list(range(vrange[0], vrange[1]+1)) + if vector in vector_range: + raise ValueError("Vector '{}' already in '{}' map!".format(str(vector), name)) + vector_range[vector] = vrange + return vector_range + diff --git a/modm_devices/stm32/device.py b/modm_devices/stm32/device.py new file mode 100644 index 00000000..3d7155ea --- /dev/null +++ b/modm_devices/stm32/device.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2016, Fabian Greif +# Copyright (c) 2016, Niklas Hauser +# All rights reserved. + +from .gpio import DriverGpio +from .core import DriverCore +from .flash import DriverFlash +from ..device import Device +from ..cache import cached_property +from ..access import copy_keys + + +class Stm32Device(Device): + def __init__(self, identifier, device_file): + Device.__init__(self, identifier, device_file) + + @cached_property + def gpio(self): + return DriverGpio(self) + + @cached_property + def core(self): + return DriverCore(self) + + @cached_property + def flash(self): + return DriverFlash(self) + + @cached_property + def peripherals(self): + all_peripherals = [] + for s in self.gpio.signals_all: + d = copy_keys(s, "driver", "instance") + if len(d): all_peripherals.append(d); + + # Signals are not enough, since there are peripherals that don't have signals. + # Example: STM32F401RE < 64pins: SPI4 cannot be connected to any pins. + for d in self._properties["driver"]: + driver = d["name"] + if driver in ["gpio", "core"]: + continue + elif "instance" in d: + all_peripherals.extend( {"driver": driver, "instance": int(i["name"])} for i in d["instance"] ) + else: + all_peripherals.append( {"driver": driver} ) + + for r in self.gpio._driver.get("remap", {}): + d = copy_keys(r, "driver", "instance") + if len(d): all_peripherals.append(d); + + return all_peripherals diff --git a/modm_devices/stm32/flash.py b/modm_devices/stm32/flash.py new file mode 100644 index 00000000..3088ebc9 --- /dev/null +++ b/modm_devices/stm32/flash.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2020, Niklas Hauser +# All rights reserved. + +from ..cache import cached_property +from ..driver import Driver +from collections import defaultdict + +class DriverFlash(Driver): + def __init__(self, device): + Driver.__init__(self, device, device._find_first_driver("flash")) + + + @cached_property + def wait_states(self): + """ + :return: a map from int(min Vcore): [int(max F) for 0 wait states, ..., int(max F) for N wait states]. + """ + states = {} + for vcore in self._driver.get("latency", []): + states[int(vcore["vcore-min"])] = sorted([int(f["hclk-max"]) for f in vcore["wait-state"]]) + return states diff --git a/modm_devices/stm32/gpio.py b/modm_devices/stm32/gpio.py new file mode 100644 index 00000000..04f706b7 --- /dev/null +++ b/modm_devices/stm32/gpio.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2020, Niklas Hauser +# All rights reserved. + +from collections import defaultdict +from ..cache import * +from ..access import copy_keys, copy_deep +from ..driver import Driver + +class DriverGpio(Driver): + def __init__(self, device): + Driver.__init__(self, device, device._find_first_driver("gpio")) + + @cached_property + def ranges(self): + """ + Computes all port ranges on this device in the form of a map: + + - "name": port.upper() + - "start": min(pin) + - "width": max(pin) - min(pin) + + :return: a list of port ranges + """ + ports = defaultdict(list) + for gpio in self._driver["gpio"]: + ports[gpio["port"]].append(int(gpio["pin"])) + + ports = [{"name": k, + "start": min(v), + "width": max(v) - min(v) + 1} for k,v in ports.items()] + ports.sort(key=lambda p: p["name"]) + return ports + + @cached_property + def ports(self): + """ + Computes all ports on this device. + + :return: a sorted unique list of ports in uppercase letters. + """ + ports = set(p["port"] for p in self._driver["gpio"]) + return list(sorted(ports)) + + @cached_property + def pins(self): + """ + Computes all pins on this device. + + :return: a sorted unique list of (port.upper(), int(pin)) tuples. + """ + pins = set((p["port"], int(p["pin"])) for p in self._driver["gpio"]) + return list(sorted(pins)) + + def signals(self, port, pin): + return self._signals.get((port.lower(), pin)) + + # @cached_function + def signals_by_name(self, port, pin): + signals = self.signals(port, pin) + names = defaultdict(list) + for s in signals: + names[s["name"]].append(s) + return dict(names) + + @cached_property + def signals_remap(self): + return copy_deep(self._driver.get("remap", [])) + + @cached_property + def package_remap(self): + # Compute the set of remapped pins + remapped_gpios = {} + for p in self._driver["package"][0]["pin"]: + variant = p.get("variant", "") + if "remap" in variant: # also matches "remap-default" + name = p["name"][1:4].strip().lower() + if len(name) > 2 and not name[2].isdigit(): + name = name[:2] + remapped_gpios[name] = (variant == "remap") # "remap-default" -> False + return remapped_gpios + + @cached_property + def signals_group(self): + sgroup = defaultdict(list) + if "f1" in self.type: + # Convert the map from a list of signals to a list of pins + for remap in self._driver["remap"]: + for group in remap["group"]: + for signal in group["signal"]: + key = (signal["port"], int(signal["pin"])) + + for sig in sgroup[key]: + if ((sig["driver"], sig.get("instance", 0)) == + (remap["driver"], int(remap.get("instance", 0))) and + sig["name"] == signal["name"]): + sig["group"].append(int(group["id"])) + break + else: + sig = copy_keys(remap, "driver", ("instance", int)) + sig["name"] = signal["name"] + sig["group"]= [int(group["id"])] + sgroup[key].append(sig) + return dict(sgroup) + + + @cached_property + def signals_all(self): + asigs = list() + for signals in self._signals.values(): + for s in signals: + asigs.append(copy_keys(s, "name", "driver", ("instance", int))) + return asigs + + @cached_property + def _signals(self): + """ + :return: + """ + signals_map = {} + for gpio in self._driver["gpio"]: + key = (gpio["port"], int(gpio["pin"])) + + raw_signals = copy_deep(gpio.get("signal", [])) + # raw_signals = gpio.get("signal", []) + if key in self.signals_group: + raw_signals.extend(self.signals_group[key]) + + for s in raw_signals: + s.update(copy_keys(s, ("af", int), ("instance", int))) + s["is_analog"] = any(s.get("driver", "").startswith(p) for p in {"adc", "dac", "comp"}) + if s.get("driver", "").startswith("adc") and s["name"].startswith("in"): + s["analog_channel"] = int("".join(filter(str.isdigit, s["name"]))) + + signals_map[key] = raw_signals + + # print(signals_map) + return signals_map + +