SPKT

Dependencies:   F746_GUI SD_PlayerSkeleton F746_SAI_IO

Committer:
phungductung
Date:
Tue Jun 04 21:37:21 2019 +0000
Revision:
0:8ede47d38d10
SPKT

Who changed what in which revision?

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