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 """
switches 0:5c4d7b2438d3 2 mbed SDK
switches 0:5c4d7b2438d3 3 Copyright (c) 2011-2016 ARM Limited
switches 0:5c4d7b2438d3 4
switches 0:5c4d7b2438d3 5 Licensed under the Apache License, Version 2.0 (the "License");
switches 0:5c4d7b2438d3 6 you may not use this file except in compliance with the License.
switches 0:5c4d7b2438d3 7 You may obtain a copy of the License at
switches 0:5c4d7b2438d3 8
switches 0:5c4d7b2438d3 9 http://www.apache.org/licenses/LICENSE-2.0
switches 0:5c4d7b2438d3 10
switches 0:5c4d7b2438d3 11 Unless required by applicable law or agreed to in writing, software
switches 0:5c4d7b2438d3 12 distributed under the License is distributed on an "AS IS" BASIS,
switches 0:5c4d7b2438d3 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
switches 0:5c4d7b2438d3 14 See the License for the specific language governing permissions and
switches 0:5c4d7b2438d3 15 limitations under the License.
switches 0:5c4d7b2438d3 16 """
switches 0:5c4d7b2438d3 17 from exporters import Exporter
switches 0:5c4d7b2438d3 18 from os.path import basename
switches 0:5c4d7b2438d3 19
switches 0:5c4d7b2438d3 20
switches 0:5c4d7b2438d3 21 class DS5_5(Exporter):
switches 0:5c4d7b2438d3 22 NAME = 'DS5'
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24 TARGETS = [
switches 0:5c4d7b2438d3 25 'LPC1768',
switches 0:5c4d7b2438d3 26 'LPC11U24',
switches 0:5c4d7b2438d3 27 'LPC812',
switches 0:5c4d7b2438d3 28 'UBLOX_C027',
switches 0:5c4d7b2438d3 29 'ARCH_PRO',
switches 0:5c4d7b2438d3 30 'RZ_A1H',
switches 0:5c4d7b2438d3 31 ]
switches 0:5c4d7b2438d3 32
switches 0:5c4d7b2438d3 33 USING_MICROLIB = [
switches 0:5c4d7b2438d3 34 'LPC812',
switches 0:5c4d7b2438d3 35 ]
switches 0:5c4d7b2438d3 36
switches 0:5c4d7b2438d3 37 FILE_TYPES = {
switches 0:5c4d7b2438d3 38 'c_sources':'1',
switches 0:5c4d7b2438d3 39 'cpp_sources':'8',
switches 0:5c4d7b2438d3 40 's_sources':'2'
switches 0:5c4d7b2438d3 41 }
switches 0:5c4d7b2438d3 42
switches 0:5c4d7b2438d3 43 TOOLCHAIN = "ARM"
switches 0:5c4d7b2438d3 44
switches 0:5c4d7b2438d3 45 def get_toolchain(self):
switches 0:5c4d7b2438d3 46 return 'uARM' if (self.target in self.USING_MICROLIB) else 'ARM'
switches 0:5c4d7b2438d3 47
switches 0:5c4d7b2438d3 48 def generate(self):
switches 0:5c4d7b2438d3 49 source_files = []
switches 0:5c4d7b2438d3 50 for r_type, n in DS5_5.FILE_TYPES.iteritems():
switches 0:5c4d7b2438d3 51 for file in getattr(self.resources, r_type):
switches 0:5c4d7b2438d3 52 source_files.append({
switches 0:5c4d7b2438d3 53 'name': basename(file), 'type': n, 'path': file
switches 0:5c4d7b2438d3 54 })
switches 0:5c4d7b2438d3 55
switches 0:5c4d7b2438d3 56 ctx = {
switches 0:5c4d7b2438d3 57 'name': self.project_name,
switches 0:5c4d7b2438d3 58 'include_paths': self.resources.inc_dirs,
switches 0:5c4d7b2438d3 59 'scatter_file': self.resources.linker_script,
switches 0:5c4d7b2438d3 60 'object_files': self.resources.objects + self.resources.libraries,
switches 0:5c4d7b2438d3 61 'source_files': source_files,
switches 0:5c4d7b2438d3 62 'symbols': self.toolchain.get_symbols()
switches 0:5c4d7b2438d3 63 }
switches 0:5c4d7b2438d3 64 target = self.target.lower()
switches 0:5c4d7b2438d3 65
switches 0:5c4d7b2438d3 66 # Project file
switches 0:5c4d7b2438d3 67 self.gen_file('ds5_5_%s.project.tmpl' % target, ctx, '.project')
switches 0:5c4d7b2438d3 68 self.gen_file('ds5_5_%s.cproject.tmpl' % target, ctx, '.cproject')
switches 0:5c4d7b2438d3 69 self.gen_file('ds5_5_%s.launch.tmpl' % target, ctx, 'ds5_%s.launch' % target)