Development mbed library for MAX32630FTHR

Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Dec 16 16:27:57 2016 +0000
Revision:
3:1198227e6421
Parent:
0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:5c4d7b2438d3 1 #! /usr/bin/env python2
switches 0:5c4d7b2438d3 2 """
switches 0:5c4d7b2438d3 3 mbed SDK
switches 0:5c4d7b2438d3 4 Copyright (c) 2011-2013 ARM Limited
switches 0:5c4d7b2438d3 5
switches 0:5c4d7b2438d3 6 Licensed under the Apache License, Version 2.0 (the "License");
switches 0:5c4d7b2438d3 7 you may not use this file except in compliance with the License.
switches 0:5c4d7b2438d3 8 You may obtain a copy of the License at
switches 0:5c4d7b2438d3 9
switches 0:5c4d7b2438d3 10 http://www.apache.org/licenses/LICENSE-2.0
switches 0:5c4d7b2438d3 11
switches 0:5c4d7b2438d3 12 Unless required by applicable law or agreed to in writing, software
switches 0:5c4d7b2438d3 13 distributed under the License is distributed on an "AS IS" BASIS,
switches 0:5c4d7b2438d3 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
switches 0:5c4d7b2438d3 15 See the License for the specific language governing permissions and
switches 0:5c4d7b2438d3 16 limitations under the License.
switches 0:5c4d7b2438d3 17 """
switches 0:5c4d7b2438d3 18 import sys
switches 0:5c4d7b2438d3 19 import os
switches 0:5c4d7b2438d3 20
switches 0:5c4d7b2438d3 21 ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
switches 0:5c4d7b2438d3 22 sys.path.insert(0, ROOT)
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24 from tools.options import get_default_options_parser
switches 0:5c4d7b2438d3 25
switches 0:5c4d7b2438d3 26 # Check: Extra modules which are required by core test suite
switches 0:5c4d7b2438d3 27 from tools.utils import check_required_modules
switches 0:5c4d7b2438d3 28 check_required_modules(['prettytable'])
switches 0:5c4d7b2438d3 29
switches 0:5c4d7b2438d3 30 # Imports related to mbed build api
switches 0:5c4d7b2438d3 31 from tools.build_api import mcu_toolchain_matrix
switches 0:5c4d7b2438d3 32 from tools.test_api import get_autodetected_MUTS_list
switches 0:5c4d7b2438d3 33
switches 0:5c4d7b2438d3 34
switches 0:5c4d7b2438d3 35 def main():
switches 0:5c4d7b2438d3 36 """Entry Point"""
switches 0:5c4d7b2438d3 37 try:
switches 0:5c4d7b2438d3 38 # Parse Options
switches 0:5c4d7b2438d3 39 parser = get_default_options_parser()
switches 0:5c4d7b2438d3 40
switches 0:5c4d7b2438d3 41 parser.add_argument("-S", "--supported-toolchains",
switches 0:5c4d7b2438d3 42 action="store_true",
switches 0:5c4d7b2438d3 43 dest="supported_toolchains",
switches 0:5c4d7b2438d3 44 default=False,
switches 0:5c4d7b2438d3 45 help="Displays supported matrix of"
switches 0:5c4d7b2438d3 46 " targets and toolchains")
switches 0:5c4d7b2438d3 47
switches 0:5c4d7b2438d3 48 parser.add_argument('-f', '--filter',
switches 0:5c4d7b2438d3 49 dest='general_filter_regex',
switches 0:5c4d7b2438d3 50 default=None,
switches 0:5c4d7b2438d3 51 help='Filter targets')
switches 0:5c4d7b2438d3 52
switches 0:5c4d7b2438d3 53 parser.add_argument("-v", "--verbose",
switches 0:5c4d7b2438d3 54 action="store_true",
switches 0:5c4d7b2438d3 55 dest="verbose",
switches 0:5c4d7b2438d3 56 default=False,
switches 0:5c4d7b2438d3 57 help="Verbose diagnostic output")
switches 0:5c4d7b2438d3 58
switches 0:5c4d7b2438d3 59 options = parser.parse_args()
switches 0:5c4d7b2438d3 60
switches 0:5c4d7b2438d3 61 # Only prints matrix of supported toolchains
switches 0:5c4d7b2438d3 62 if options.supported_toolchains:
switches 0:5c4d7b2438d3 63 print mcu_toolchain_matrix(
switches 0:5c4d7b2438d3 64 platform_filter=options.general_filter_regex)
switches 0:5c4d7b2438d3 65 exit(0)
switches 0:5c4d7b2438d3 66
switches 0:5c4d7b2438d3 67 # If auto_detect attribute is present, we assume other auto-detection
switches 0:5c4d7b2438d3 68 # parameters like 'toolchains_filter' are also set.
switches 0:5c4d7b2438d3 69 muts = get_autodetected_MUTS_list()
switches 0:5c4d7b2438d3 70
switches 0:5c4d7b2438d3 71 count = 0
switches 0:5c4d7b2438d3 72 for mut in muts.values():
switches 0:5c4d7b2438d3 73 print ""
switches 0:5c4d7b2438d3 74 print "[mbed] Detected %s, port %s, mounted %s" % \
switches 0:5c4d7b2438d3 75 (mut['mcu'], mut['port'], mut['disk'])
switches 0:5c4d7b2438d3 76 print "[mbed] Supported toolchains for %s" % mut['mcu']
switches 0:5c4d7b2438d3 77 print mcu_toolchain_matrix(platform_filter=r'^'+mut['mcu']+'$')
switches 0:5c4d7b2438d3 78 count += 1
switches 0:5c4d7b2438d3 79
switches 0:5c4d7b2438d3 80 if count == 0:
switches 0:5c4d7b2438d3 81 print "[mbed] No mbed targets where detected on your system."
switches 0:5c4d7b2438d3 82
switches 0:5c4d7b2438d3 83 except KeyboardInterrupt:
switches 0:5c4d7b2438d3 84 print "\n[CTRL+c] exit"
switches 0:5c4d7b2438d3 85 except Exception as exc:
switches 0:5c4d7b2438d3 86 import traceback
switches 0:5c4d7b2438d3 87 traceback.print_exc(file=sys.stdout)
switches 0:5c4d7b2438d3 88 print "[ERROR] %s" % str(exc)
switches 0:5c4d7b2438d3 89 sys.exit(1)
switches 0:5c4d7b2438d3 90
switches 0:5c4d7b2438d3 91 if __name__ == '__main__':
switches 0:5c4d7b2438d3 92 main()