mbed-os/workspace_tools/targets.py

256 lines
5.7 KiB
Python
Raw Normal View History

2013-08-06 13:38:00 +00:00
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
CORE_LABELS = {
"ARM7TDMI-S": "ARM7",
"Cortex-M0" : "M0",
"Cortex-M0+": "M0P",
"Cortex-M3" : "M3",
"Cortex-M4" : "M4"
}
class Target:
def __init__(self):
# ARM Core
self.core = None
2013-08-09 16:18:50 +00:00
# Is the disk provided by the interface chip of this board virtual?
self.is_disk_virtual = False
2013-08-09 16:18:50 +00:00
# list of toolchains that are supported by the mbed SDK for this target
self.supported_toolchains = None
2013-08-09 16:18:50 +00:00
# list of extra specific labels
self.extra_labels = []
2013-08-09 16:18:50 +00:00
self.name = self.__class__.__name__
2013-08-09 16:18:50 +00:00
def program_cycle_s(self):
return 4 if self.is_disk_virtual else 1.5
2013-08-09 16:18:50 +00:00
def get_labels(self):
return [self.name, CORE_LABELS[self.core]] + self.extra_labels
class LPC2368(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "ARM7TDMI-S"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC23XX']
2013-08-09 16:18:50 +00:00
self.supported_toolchains = ["ARM"]
class LPC1768(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M3"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC176X']
2013-08-09 16:18:50 +00:00
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "GCC_CS", "GCC_CR", "IAR"]
class LPC11U24(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M0"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC11UXX', 'LPC11U24_401']
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
2013-08-09 16:21:03 +00:00
class LPC11U24_301(Target):
def __init__(self):
Target.__init__(self)
self.core = "Cortex-M0"
self.extra_labels = ['NXP', 'LPC11UXX']
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
class KL05Z(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M0+"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['Freescale']
2013-08-09 16:18:50 +00:00
self.supported_toolchains = ["ARM"]
2013-08-09 16:18:50 +00:00
self.is_disk_virtual = True
class KL25Z(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M0+"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['Freescale']
2013-08-09 16:18:50 +00:00
2013-08-02 05:14:36 +00:00
self.supported_toolchains = ["ARM", "GCC_CW_EWL", "GCC_CW_NEWLIB", "GCC_ARM"]
2013-08-09 16:18:50 +00:00
self.is_disk_virtual = True
class LPC812(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M0+"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC81X']
2013-08-09 16:18:50 +00:00
self.supported_toolchains = ["uARM"]
2013-08-09 16:18:50 +00:00
self.is_disk_virtual = True
2013-05-16 06:53:02 +00:00
class LPC4088(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
2013-05-16 06:53:02 +00:00
self.core = "Cortex-M4"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC408X']
2013-08-09 16:18:50 +00:00
2013-05-16 06:53:02 +00:00
self.supported_toolchains = ["ARM", "GCC_CR"]
2013-07-08 03:27:11 +00:00
class LPC4330_M4(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
2013-05-16 06:53:02 +00:00
self.core = "Cortex-M4"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['NXP', 'LPC43XX']
2013-08-09 16:18:50 +00:00
2013-06-25 06:20:08 +00:00
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
2013-07-08 03:27:11 +00:00
class LPC4330_M0(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.core = "Cortex-M0"
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.extra_labels = ['NXP', 'LPC43XX']
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
class LPC1800(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.core = "Cortex-M3"
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.extra_labels = ['NXP', 'LPC43XX']
2013-08-09 16:18:50 +00:00
2013-07-08 03:27:11 +00:00
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
2013-08-09 16:18:50 +00:00
class STM32F407(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M4"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['STM', 'STM32F4XX']
2013-08-09 16:18:50 +00:00
2013-07-29 16:03:19 +00:00
self.supported_toolchains = ["ARM", "GCC_ARM"]
2013-05-16 06:53:02 +00:00
class MBED_MCU(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
self.core = "Cortex-M0+"
2013-08-09 16:18:50 +00:00
self.extra_labels = ['ARM']
2013-08-09 16:18:50 +00:00
self.supported_toolchains = ["ARM"]
2013-08-09 16:18:50 +00:00
2013-07-17 13:11:54 +00:00
class LPC1347(Target):
def __init__(self):
Target.__init__(self)
2013-08-09 16:18:50 +00:00
2013-07-17 13:11:54 +00:00
self.core = "Cortex-M3"
2013-08-09 16:18:50 +00:00
2013-07-17 13:11:54 +00:00
self.extra_labels = ['NXP', 'LPC13XX']
2013-08-09 16:18:50 +00:00
2013-07-17 13:11:54 +00:00
self.supported_toolchains = ["ARM", "GCC_ARM"]
2013-08-09 16:18:50 +00:00
class LPC1114(Target):
2013-08-09 16:18:50 +00:00
def __init__(self):
Target.__init__(self)
self.core = "Cortex-M0"
self.extra_labels = ['NXP', 'LPC11XX']
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
class LPC11C24(Target):
def __init__(self):
Target.__init__(self)
self.core = "Cortex-M0"
self.extra_labels = ['NXP', 'LPC11CXX']
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
2013-08-09 16:18:50 +00:00
# Get a single instance for each target
TARGETS = [
LPC2368(),
LPC1768(),
LPC11U24(),
2013-08-09 16:18:50 +00:00
LPC11U24_301(),
KL05Z(),
KL25Z(),
LPC812(),
2013-05-16 06:53:02 +00:00
LPC4088(),
2013-07-08 14:58:15 +00:00
LPC4330_M4(),
STM32F407(),
2013-07-17 13:11:54 +00:00
MBED_MCU(),
LPC1347(),
2013-08-09 16:18:50 +00:00
LPC1114(),
LPC11C24()
]
# Map each target name to its unique instance
TARGET_MAP = {}
for t in TARGETS:
TARGET_MAP[t.name] = t
TARGET_NAMES = TARGET_MAP.keys()