mbed-os for GR-LYCHEE

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers __init__.py Source File

__init__.py

00001 """
00002 mbed SDK
00003 Copyright (c) 2011-2013 ARM Limited
00004 
00005 Licensed under the Apache License, Version 2.0 (the "License");
00006 you may not use this file except in compliance with the License.
00007 You may obtain a copy of the License at
00008 
00009     http://www.apache.org/licenses/LICENSE-2.0
00010 
00011 Unless required by applicable law or agreed to in writing, software
00012 distributed under the License is distributed on an "AS IS" BASIS,
00013 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 See the License for the specific language governing permissions and
00015 limitations under the License.
00016 """
00017 
00018 import host_test_registry
00019 
00020 # This plugins provide 'flashing' methods to host test scripts
00021 import module_copy_mbed
00022 import module_copy_shell
00023 import module_copy_silabs
00024 
00025 try:
00026     import module_copy_smart
00027 except:
00028     pass
00029 
00030 #import module_copy_firefox
00031 import module_copy_mps2
00032 
00033 # Plugins used to reset certain platform
00034 import module_reset_mbed
00035 import module_reset_silabs
00036 import module_reset_mps2
00037 
00038 
00039 # Plugin registry instance
00040 HOST_TEST_PLUGIN_REGISTRY = host_test_registry.HostTestRegistry()
00041 
00042 # Static plugin registration
00043 # Some plugins are commented out if they are not stable or not commonly used
00044 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mbed.load_plugin())
00045 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_shell.load_plugin())
00046 
00047 try:
00048     HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_smart.load_plugin())
00049 except:
00050     pass
00051 
00052 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mbed.load_plugin())
00053 #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_firefox.load_plugin())
00054 
00055 # Extra platforms support
00056 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mps2.load_plugin())
00057 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mps2.load_plugin())
00058 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_silabs.load_plugin())
00059 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_silabs.load_plugin())
00060 
00061 # TODO: extend plugin loading to files with name module_*.py loaded ad-hoc
00062 
00063 ###############################################################################
00064 # Functional interface for host test plugin registry
00065 ###############################################################################
00066 def call_plugin(type, capability, *args, **kwargs):
00067     """ Interface to call plugin registry functional way
00068     """
00069     return HOST_TEST_PLUGIN_REGISTRY.call_plugin(type, capability, *args, **kwargs)
00070 
00071 def get_plugin_caps (type):
00072     """ Returns list of all capabilities for plugin family with the same type.
00073         If there are no capabilities empty list is returned
00074     """
00075     return HOST_TEST_PLUGIN_REGISTRY.get_plugin_caps(type)
00076 
00077 def print_plugin_info ():
00078     """ Prints plugins' information in user friendly way
00079     """
00080     print HOST_TEST_PLUGIN_REGISTRY