printer

Dependents:   Good_Serial_HelloWorld_Mbed

Fork of mbed by gokmen ascioglu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbed_interface.h Source File

mbed_interface.h

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