Development mbed library for MAX32630FTHR
Dependents: blinky_max32630fthr
tools/export/__init__.py@3:1198227e6421, 2016-12-16 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
switches | 0:5c4d7b2438d3 | 1 | """The generic interface for all exporters. |
switches | 0:5c4d7b2438d3 | 2 | """ |
switches | 0:5c4d7b2438d3 | 3 | # mbed SDK |
switches | 0:5c4d7b2438d3 | 4 | # Copyright (c) 2011-2016 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 | from tools.export import codered, ds5_5, iar, makefile |
switches | 0:5c4d7b2438d3 | 19 | from tools.export import emblocks, coide, kds, simplicityv3, atmelstudio |
switches | 0:5c4d7b2438d3 | 20 | from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt |
switches | 0:5c4d7b2438d3 | 21 | from tools.targets import TARGET_NAMES |
switches | 0:5c4d7b2438d3 | 22 | |
switches | 0:5c4d7b2438d3 | 23 | EXPORTERS = { |
switches | 0:5c4d7b2438d3 | 24 | 'uvision5': uvision.Uvision, |
switches | 0:5c4d7b2438d3 | 25 | 'uvision': uvision.Uvision, |
switches | 0:5c4d7b2438d3 | 26 | 'lpcxpresso': codered.CodeRed, |
switches | 0:5c4d7b2438d3 | 27 | 'gcc_arm': makefile.GccArm, |
switches | 0:5c4d7b2438d3 | 28 | 'make_gcc_arm': makefile.GccArm, |
switches | 0:5c4d7b2438d3 | 29 | 'make_armc5': makefile.Armc5, |
switches | 0:5c4d7b2438d3 | 30 | 'make_iar': makefile.IAR, |
switches | 0:5c4d7b2438d3 | 31 | 'ds5_5': ds5_5.DS5_5, |
switches | 0:5c4d7b2438d3 | 32 | 'iar': iar.IAR, |
switches | 0:5c4d7b2438d3 | 33 | 'emblocks' : emblocks.IntermediateFile, |
switches | 0:5c4d7b2438d3 | 34 | 'coide' : coide.CoIDE, |
switches | 0:5c4d7b2438d3 | 35 | 'kds' : kds.KDS, |
switches | 0:5c4d7b2438d3 | 36 | 'simplicityv3' : simplicityv3.SimplicityV3, |
switches | 0:5c4d7b2438d3 | 37 | 'atmelstudio' : atmelstudio.AtmelStudio, |
switches | 0:5c4d7b2438d3 | 38 | 'sw4stm32' : sw4stm32.Sw4STM32, |
switches | 0:5c4d7b2438d3 | 39 | 'e2studio' : e2studio.E2Studio, |
switches | 0:5c4d7b2438d3 | 40 | 'eclipse_gcc_arm' : cdt.EclipseGcc, |
switches | 0:5c4d7b2438d3 | 41 | 'eclipse_iar' : cdt.EclipseIAR, |
switches | 0:5c4d7b2438d3 | 42 | 'eclipse_armc5' : cdt.EclipseArmc5, |
switches | 0:5c4d7b2438d3 | 43 | 'zip' : zip.ZIP, |
switches | 0:5c4d7b2438d3 | 44 | 'cmsis' : cmsis.CMSIS |
switches | 0:5c4d7b2438d3 | 45 | } |
switches | 0:5c4d7b2438d3 | 46 | |
switches | 0:5c4d7b2438d3 | 47 | ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN = """ |
switches | 0:5c4d7b2438d3 | 48 | Sorry, the target %s is not currently supported on the %s toolchain. |
switches | 0:5c4d7b2438d3 | 49 | Please refer to <a href='/handbook/Exporting-to-offline-toolchains' target='_blank'>Exporting to offline toolchains</a> for more information. |
switches | 0:5c4d7b2438d3 | 50 | """ |
switches | 0:5c4d7b2438d3 | 51 | |
switches | 0:5c4d7b2438d3 | 52 | ERROR_MESSAGE_NOT_EXPORT_LIBS = """ |
switches | 0:5c4d7b2438d3 | 53 | To export this project please <a href='http://mbed.org/compiler/?import=http://mbed.org/users/mbed_official/code/mbed-export/k&mode=lib' target='_blank'>import the export version of the mbed library</a>. |
switches | 0:5c4d7b2438d3 | 54 | """ |
switches | 0:5c4d7b2438d3 | 55 | |
switches | 0:5c4d7b2438d3 | 56 | def mcu_ide_matrix(verbose_html=False): |
switches | 0:5c4d7b2438d3 | 57 | """Shows target map using prettytable |
switches | 0:5c4d7b2438d3 | 58 | |
switches | 0:5c4d7b2438d3 | 59 | Keyword argumets: |
switches | 0:5c4d7b2438d3 | 60 | verbose_html - print the matrix in html format |
switches | 0:5c4d7b2438d3 | 61 | """ |
switches | 0:5c4d7b2438d3 | 62 | supported_ides = sorted(EXPORTERS.keys()) |
switches | 0:5c4d7b2438d3 | 63 | # Only use it in this function so building works without extra modules |
switches | 0:5c4d7b2438d3 | 64 | from prettytable import PrettyTable, ALL |
switches | 0:5c4d7b2438d3 | 65 | |
switches | 0:5c4d7b2438d3 | 66 | # All tests status table print |
switches | 0:5c4d7b2438d3 | 67 | table_printer = PrettyTable(["Platform"] + supported_ides) |
switches | 0:5c4d7b2438d3 | 68 | # Align table |
switches | 0:5c4d7b2438d3 | 69 | for col in supported_ides: |
switches | 0:5c4d7b2438d3 | 70 | table_printer.align[col] = "c" |
switches | 0:5c4d7b2438d3 | 71 | table_printer.align["Platform"] = "l" |
switches | 0:5c4d7b2438d3 | 72 | |
switches | 0:5c4d7b2438d3 | 73 | perm_counter = 0 |
switches | 0:5c4d7b2438d3 | 74 | for target in sorted(TARGET_NAMES): |
switches | 0:5c4d7b2438d3 | 75 | row = [target] # First column is platform name |
switches | 0:5c4d7b2438d3 | 76 | for ide in supported_ides: |
switches | 0:5c4d7b2438d3 | 77 | text = "-" |
switches | 0:5c4d7b2438d3 | 78 | if target in EXPORTERS[ide].TARGETS: |
switches | 0:5c4d7b2438d3 | 79 | if verbose_html: |
switches | 0:5c4d7b2438d3 | 80 | text = "✓" |
switches | 0:5c4d7b2438d3 | 81 | else: |
switches | 0:5c4d7b2438d3 | 82 | text = "x" |
switches | 0:5c4d7b2438d3 | 83 | perm_counter += 1 |
switches | 0:5c4d7b2438d3 | 84 | row.append(text) |
switches | 0:5c4d7b2438d3 | 85 | table_printer.add_row(row) |
switches | 0:5c4d7b2438d3 | 86 | |
switches | 0:5c4d7b2438d3 | 87 | table_printer.border = True |
switches | 0:5c4d7b2438d3 | 88 | table_printer.vrules = ALL |
switches | 0:5c4d7b2438d3 | 89 | table_printer.hrules = ALL |
switches | 0:5c4d7b2438d3 | 90 | # creates a html page in a shorter format suitable for readme.md |
switches | 0:5c4d7b2438d3 | 91 | if verbose_html: |
switches | 0:5c4d7b2438d3 | 92 | result = table_printer.get_html_string() |
switches | 0:5c4d7b2438d3 | 93 | else: |
switches | 0:5c4d7b2438d3 | 94 | result = table_printer.get_string() |
switches | 0:5c4d7b2438d3 | 95 | result += "\n" |
switches | 0:5c4d7b2438d3 | 96 | result += "Total IDEs: %d\n"% (len(supported_ides)) |
switches | 0:5c4d7b2438d3 | 97 | if verbose_html: |
switches | 0:5c4d7b2438d3 | 98 | result += "<br>" |
switches | 0:5c4d7b2438d3 | 99 | result += "Total platforms: %d\n"% (len(TARGET_NAMES)) |
switches | 0:5c4d7b2438d3 | 100 | if verbose_html: |
switches | 0:5c4d7b2438d3 | 101 | result += "<br>" |
switches | 0:5c4d7b2438d3 | 102 | result += "Total permutations: %d"% (perm_counter) |
switches | 0:5c4d7b2438d3 | 103 | if verbose_html: |
switches | 0:5c4d7b2438d3 | 104 | result = result.replace("&", "&") |
switches | 0:5c4d7b2438d3 | 105 | return result |