Mangue Baja Box

Dependencies:   mbed

Committer:
einsteingustavo
Date:
Mon Jul 29 20:38:00 2019 +0000
Revision:
0:0dee8840a1c0
Mangue Baja Box

Who changed what in which revision?

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