Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format

Dependents:   NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more

Fork of mbed by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbed_interface.h Source File

mbed_interface.h

00001 /** Functions to control the mbed interface
00002  *
00003  * mbed Microcontrollers have a built-in interface to provide functionality such as 
00004  * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file 
00005  * system. These functions provide means to control the interface suing semihost
00006  * calls it supports.
00007  */
00008  
00009 /* mbed Microcontroller Library - mbed_interface
00010  * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
00011  */
00012  
00013 #ifndef MBED_INTERFACE_H
00014 #define MBED_INTERFACE_H
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 /** Determine whether the mbed interface is connected, based on whether debug is enabled
00021  * 
00022  *  @returns
00023  *    1 if interface is connected,
00024  *    0 otherwise
00025  */
00026 int mbed_interface_connected(void);
00027 
00028 /** Instruct the mbed interface to reset, as if the reset button had been pressed
00029  *
00030  *  @returns
00031  *    1 if successful,
00032  *    0 otherwise (e.g. interface not present)
00033  */
00034 int mbed_interface_reset(void);
00035 
00036 /** This will disconnect the debug aspect of the interface, so semihosting will be disabled.
00037  *  The interface will still support the USB serial aspect
00038  *
00039  *  @returns
00040  *    0 if successful,
00041  *   -1 otherwise (e.g. interface not present)
00042  */
00043 int mbed_interface_disconnect(void);
00044 
00045 /** This will disconnect the debug aspect of the interface, and if the USB cable is not 
00046  *  connected, also power down the interface. If the USB cable is connected, the interface
00047  *  will remain powered up and visible to the host 
00048  *
00049  *  @returns
00050  *    0 if successful,
00051  *   -1 otherwise (e.g. interface not present)
00052  */
00053 int mbed_interface_powerdown(void);
00054 
00055 /** This returns a string containing the 32-character UID of the mbed interface
00056  *  This is a weak function that can be overwritten if required
00057  *
00058  *  @param uid A 33-byte array to write the null terminated 32-byte string
00059  *
00060  *  @returns
00061  *    0 if successful,
00062  *   -1 otherwise (e.g. interface not present)
00063  */
00064 int mbed_interface_uid(char *uid);
00065 
00066 /** This returns a unique 6-byte MAC address, based on the interface UID
00067  *  If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00)
00068  *
00069  *  This is a weak function that can be overwritten if you want to provide your own mechanism to
00070  *  provide a MAC address.
00071  *
00072  *  @param mac A 6-byte array to write the MAC address
00073  */
00074 void mbed_mac_address(char *mac);
00075 
00076 /** Cause the mbed to flash the BLOD LED sequence
00077  */
00078 void mbed_die(void);
00079 
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083 
00084 #endif