mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Committer:
emilmont
Date:
Mon Feb 18 09:41:56 2013 +0000
Revision:
9:663789d7729f
Parent:
8:c14af7958ef5
Update mbed-KL25Z to latest build

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 9:663789d7729f 1 /* mbed Microcontroller Library
emilmont 9:663789d7729f 2 * Copyright (c) 2006-2013 ARM Limited
emilmont 9:663789d7729f 3 *
emilmont 9:663789d7729f 4 * Licensed under the Apache License, Version 2.0 (the "License");
emilmont 9:663789d7729f 5 * you may not use this file except in compliance with the License.
emilmont 9:663789d7729f 6 * You may obtain a copy of the License at
emilmont 0:8024c367e29f 7 *
emilmont 9:663789d7729f 8 * http://www.apache.org/licenses/LICENSE-2.0
emilmont 9:663789d7729f 9 *
emilmont 9:663789d7729f 10 * Unless required by applicable law or agreed to in writing, software
emilmont 9:663789d7729f 11 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 9:663789d7729f 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 9:663789d7729f 13 * See the License for the specific language governing permissions and
emilmont 9:663789d7729f 14 * limitations under the License.
emilmont 0:8024c367e29f 15 */
emilmont 0:8024c367e29f 16 #ifndef MBED_INTERFACE_H
emilmont 0:8024c367e29f 17 #define MBED_INTERFACE_H
emilmont 0:8024c367e29f 18
emilmont 9:663789d7729f 19 #include "device.h"
emilmont 9:663789d7729f 20
emilmont 0:8024c367e29f 21 #ifdef __cplusplus
emilmont 0:8024c367e29f 22 extern "C" {
emilmont 0:8024c367e29f 23 #endif
emilmont 0:8024c367e29f 24
emilmont 9:663789d7729f 25 #if DEVICE_SEMIHOST
emilmont 9:663789d7729f 26
emilmont 9:663789d7729f 27 /** Functions to control the mbed interface
emilmont 9:663789d7729f 28 *
emilmont 9:663789d7729f 29 * mbed Microcontrollers have a built-in interface to provide functionality such as
emilmont 9:663789d7729f 30 * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file
emilmont 9:663789d7729f 31 * system. These functions provide means to control the interface suing semihost
emilmont 9:663789d7729f 32 * calls it supports.
emilmont 9:663789d7729f 33 */
emilmont 9:663789d7729f 34
emilmont 8:c14af7958ef5 35 /** Determine whether the mbed interface is connected, based on whether debug is enabled
emilmont 9:663789d7729f 36 *
emilmont 8:c14af7958ef5 37 * @returns
emilmont 8:c14af7958ef5 38 * 1 if interface is connected,
emilmont 8:c14af7958ef5 39 * 0 otherwise
emilmont 0:8024c367e29f 40 */
emilmont 0:8024c367e29f 41 int mbed_interface_connected(void);
emilmont 0:8024c367e29f 42
emilmont 8:c14af7958ef5 43 /** Instruct the mbed interface to reset, as if the reset button had been pressed
emilmont 0:8024c367e29f 44 *
emilmont 8:c14af7958ef5 45 * @returns
emilmont 8:c14af7958ef5 46 * 1 if successful,
emilmont 8:c14af7958ef5 47 * 0 otherwise (e.g. interface not present)
emilmont 0:8024c367e29f 48 */
emilmont 0:8024c367e29f 49 int mbed_interface_reset(void);
emilmont 0:8024c367e29f 50
emilmont 8:c14af7958ef5 51 /** This will disconnect the debug aspect of the interface, so semihosting will be disabled.
emilmont 0:8024c367e29f 52 * The interface will still support the USB serial aspect
emilmont 0:8024c367e29f 53 *
emilmont 8:c14af7958ef5 54 * @returns
emilmont 8:c14af7958ef5 55 * 0 if successful,
emilmont 8:c14af7958ef5 56 * -1 otherwise (e.g. interface not present)
emilmont 0:8024c367e29f 57 */
emilmont 0:8024c367e29f 58 int mbed_interface_disconnect(void);
emilmont 0:8024c367e29f 59
emilmont 9:663789d7729f 60 /** This will disconnect the debug aspect of the interface, and if the USB cable is not
emilmont 0:8024c367e29f 61 * connected, also power down the interface. If the USB cable is connected, the interface
emilmont 9:663789d7729f 62 * will remain powered up and visible to the host
emilmont 0:8024c367e29f 63 *
emilmont 8:c14af7958ef5 64 * @returns
emilmont 8:c14af7958ef5 65 * 0 if successful,
emilmont 8:c14af7958ef5 66 * -1 otherwise (e.g. interface not present)
emilmont 0:8024c367e29f 67 */
emilmont 0:8024c367e29f 68 int mbed_interface_powerdown(void);
emilmont 0:8024c367e29f 69
emilmont 8:c14af7958ef5 70 /** This returns a string containing the 32-character UID of the mbed interface
emilmont 8:c14af7958ef5 71 * This is a weak function that can be overwritten if required
emilmont 0:8024c367e29f 72 *
emilmont 8:c14af7958ef5 73 * @param uid A 33-byte array to write the null terminated 32-byte string
emilmont 0:8024c367e29f 74 *
emilmont 8:c14af7958ef5 75 * @returns
emilmont 8:c14af7958ef5 76 * 0 if successful,
emilmont 8:c14af7958ef5 77 * -1 otherwise (e.g. interface not present)
emilmont 0:8024c367e29f 78 */
emilmont 0:8024c367e29f 79 int mbed_interface_uid(char *uid);
emilmont 0:8024c367e29f 80
emilmont 9:663789d7729f 81 #endif
emilmont 9:663789d7729f 82
emilmont 8:c14af7958ef5 83 /** This returns a unique 6-byte MAC address, based on the interface UID
emilmont 0:8024c367e29f 84 * If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00)
emilmont 0:8024c367e29f 85 *
emilmont 0:8024c367e29f 86 * This is a weak function that can be overwritten if you want to provide your own mechanism to
emilmont 0:8024c367e29f 87 * provide a MAC address.
emilmont 8:c14af7958ef5 88 *
emilmont 8:c14af7958ef5 89 * @param mac A 6-byte array to write the MAC address
emilmont 0:8024c367e29f 90 */
emilmont 0:8024c367e29f 91 void mbed_mac_address(char *mac);
emilmont 0:8024c367e29f 92
emilmont 9:663789d7729f 93 /** Cause the mbed to flash the BLOD (Blue LEDs Of Death) sequence
emilmont 0:8024c367e29f 94 */
emilmont 0:8024c367e29f 95 void mbed_die(void);
emilmont 0:8024c367e29f 96
emilmont 0:8024c367e29f 97 #ifdef __cplusplus
emilmont 0:8024c367e29f 98 }
emilmont 0:8024c367e29f 99 #endif
emilmont 0:8024c367e29f 100
emilmont 0:8024c367e29f 101 #endif