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-2015 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 Author: Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>
switches 0:5c4d7b2438d3 18
switches 0:5c4d7b2438d3 19 """
switches 0:5c4d7b2438d3 20
switches 0:5c4d7b2438d3 21 import os.path
switches 0:5c4d7b2438d3 22 from ioper_base import IOperTestCaseBase
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24
switches 0:5c4d7b2438d3 25 class IOperTest_FileStructure(IOperTestCaseBase):
switches 0:5c4d7b2438d3 26
switches 0:5c4d7b2438d3 27 def __init__(self, scope=None):
switches 0:5c4d7b2438d3 28 IOperTestCaseBase.__init__(self, scope)
switches 0:5c4d7b2438d3 29
switches 0:5c4d7b2438d3 30 def if_file_exist(self, fname, fail_severity=None):
switches 0:5c4d7b2438d3 31 file_path = os.path.join(self.param['mount_point'], fname)
switches 0:5c4d7b2438d3 32 exist = os.path.isfile(file_path)
switches 0:5c4d7b2438d3 33 tr_name = "FILE_EXIST(%s)" % fname.upper()
switches 0:5c4d7b2438d3 34 if exist:
switches 0:5c4d7b2438d3 35 self.result.append((self.PASS, tr_name, self.scope, "File '%s' exists" % file_path))
switches 0:5c4d7b2438d3 36 else:
switches 0:5c4d7b2438d3 37 self.result.append((fail_severity if fail_severity else self.ERROR, tr_name, self.scope, "File '%s' not found" % file_path))
switches 0:5c4d7b2438d3 38
switches 0:5c4d7b2438d3 39 def test(self, param=None):
switches 0:5c4d7b2438d3 40 self.result = []
switches 0:5c4d7b2438d3 41 if param:
switches 0:5c4d7b2438d3 42 pass
switches 0:5c4d7b2438d3 43 return self.result
switches 0:5c4d7b2438d3 44
switches 0:5c4d7b2438d3 45
switches 0:5c4d7b2438d3 46 class IOperTest_FileStructure_Basic(IOperTest_FileStructure):
switches 0:5c4d7b2438d3 47 def __init__(self, scope=None):
switches 0:5c4d7b2438d3 48 IOperTest_FileStructure.__init__(self, scope)
switches 0:5c4d7b2438d3 49
switches 0:5c4d7b2438d3 50 def test(self, param=None):
switches 0:5c4d7b2438d3 51 self.param = param
switches 0:5c4d7b2438d3 52 self.result = []
switches 0:5c4d7b2438d3 53 if param:
switches 0:5c4d7b2438d3 54 self.if_file_exist('mbed.htm', self.ERROR)
switches 0:5c4d7b2438d3 55 return self.result
switches 0:5c4d7b2438d3 56
switches 0:5c4d7b2438d3 57
switches 0:5c4d7b2438d3 58 class IOperTest_FileStructure_MbedEnabled(IOperTest_FileStructure):
switches 0:5c4d7b2438d3 59 def __init__(self, scope=None):
switches 0:5c4d7b2438d3 60 IOperTest_FileStructure.__init__(self, scope)
switches 0:5c4d7b2438d3 61
switches 0:5c4d7b2438d3 62 def test(self, param=None):
switches 0:5c4d7b2438d3 63 self.param = param
switches 0:5c4d7b2438d3 64 self.result = []
switches 0:5c4d7b2438d3 65 if param:
switches 0:5c4d7b2438d3 66 self.if_file_exist('mbed.htm', self.ERROR)
switches 0:5c4d7b2438d3 67 self.if_file_exist('DETAILS.TXT', self.ERROR)
switches 0:5c4d7b2438d3 68 self.if_file_exist('FAIL.TXT', self.INFO)
switches 0:5c4d7b2438d3 69 return self.result