This is my quadcopter prototype software, still in development!

Committer:
Anaesthetix
Date:
Tue Jul 23 14:01:42 2013 +0000
Revision:
1:ac68f0368a77
Parent:
0:978110f7f027
Other accelerometer added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Anaesthetix 0:978110f7f027 1 /* Title: mbed_interface
Anaesthetix 0:978110f7f027 2 * Functions to control the mbed interface
Anaesthetix 0:978110f7f027 3 *
Anaesthetix 0:978110f7f027 4 * mbed Microcontrollers have a built-in interface to provide functionality such as
Anaesthetix 0:978110f7f027 5 * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file
Anaesthetix 0:978110f7f027 6 * system. These functions provide means to control the interface suing semihost
Anaesthetix 0:978110f7f027 7 * calls it supports.
Anaesthetix 0:978110f7f027 8 */
Anaesthetix 0:978110f7f027 9
Anaesthetix 0:978110f7f027 10 /* mbed Microcontroller Library - mbed_interface
Anaesthetix 0:978110f7f027 11 * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
Anaesthetix 0:978110f7f027 12 */
Anaesthetix 0:978110f7f027 13
Anaesthetix 0:978110f7f027 14 #ifndef MBED_INTERFACE_H
Anaesthetix 0:978110f7f027 15 #define MBED_INTERFACE_H
Anaesthetix 0:978110f7f027 16
Anaesthetix 0:978110f7f027 17 #ifdef __cplusplus
Anaesthetix 0:978110f7f027 18 extern "C" {
Anaesthetix 0:978110f7f027 19 #endif
Anaesthetix 0:978110f7f027 20
Anaesthetix 0:978110f7f027 21 /* Function: mbed_interface_connected
Anaesthetix 0:978110f7f027 22 * Determine whether the mbed interface is connected, based on whether debug is enabled
Anaesthetix 0:978110f7f027 23 *
Anaesthetix 0:978110f7f027 24 * Variables:
Anaesthetix 0:978110f7f027 25 * returns - 1 if interface is connected, else 0
Anaesthetix 0:978110f7f027 26 */
Anaesthetix 0:978110f7f027 27 int mbed_interface_connected(void);
Anaesthetix 0:978110f7f027 28
Anaesthetix 0:978110f7f027 29 /* Function: mbed_interface_reset
Anaesthetix 0:978110f7f027 30 * Instruct the mbed interface to reset, as if the reset button had been pressed
Anaesthetix 0:978110f7f027 31 *
Anaesthetix 0:978110f7f027 32 * Variables:
Anaesthetix 0:978110f7f027 33 * returns - 1 if successful, else 0 (e.g. interface not present)
Anaesthetix 0:978110f7f027 34 */
Anaesthetix 0:978110f7f027 35 int mbed_interface_reset(void);
Anaesthetix 0:978110f7f027 36
Anaesthetix 0:978110f7f027 37 /* Function: mbed_interface_disconnect
Anaesthetix 0:978110f7f027 38 * This will disconnect the debug aspect of the interface, so semihosting will be disabled.
Anaesthetix 0:978110f7f027 39 * The interface will still support the USB serial aspect
Anaesthetix 0:978110f7f027 40 *
Anaesthetix 0:978110f7f027 41 * Variables:
Anaesthetix 0:978110f7f027 42 * returns - 0 if successful, else -1 (e.g. interface not present)
Anaesthetix 0:978110f7f027 43 */
Anaesthetix 0:978110f7f027 44 int mbed_interface_disconnect(void);
Anaesthetix 0:978110f7f027 45
Anaesthetix 0:978110f7f027 46 /* Function: mbed_interface_powerdown
Anaesthetix 0:978110f7f027 47 * This will disconnect the debug aspect of the interface, and if the USB cable is not
Anaesthetix 0:978110f7f027 48 * connected, also power down the interface. If the USB cable is connected, the interface
Anaesthetix 0:978110f7f027 49 * will remain powered up and visible to the host
Anaesthetix 0:978110f7f027 50 *
Anaesthetix 0:978110f7f027 51 * Variables:
Anaesthetix 0:978110f7f027 52 * returns - 0 if successful, else -1 (e.g. interface not present)
Anaesthetix 0:978110f7f027 53 */
Anaesthetix 0:978110f7f027 54 int mbed_interface_powerdown(void);
Anaesthetix 0:978110f7f027 55
Anaesthetix 0:978110f7f027 56 /* Function: mbed_interface_uid
Anaesthetix 0:978110f7f027 57 * This returns a string containing the 32-character UID of the mbed interface
Anaesthetix 0:978110f7f027 58 *
Anaesthetix 0:978110f7f027 59 * This is a weak function that can be overwritten if required
Anaesthetix 0:978110f7f027 60 *
Anaesthetix 0:978110f7f027 61 * Variables:
Anaesthetix 0:978110f7f027 62 * uid - A 33-byte array to write the null terminated 32-byte string
Anaesthetix 0:978110f7f027 63 * returns - 0 if successful, else -1 (e.g. interface not present)
Anaesthetix 0:978110f7f027 64 */
Anaesthetix 0:978110f7f027 65 int mbed_interface_uid(char *uid);
Anaesthetix 0:978110f7f027 66
Anaesthetix 0:978110f7f027 67 /* Function: mbed_mac_address
Anaesthetix 0:978110f7f027 68 * This returns a unique 6-byte MAC address, based on the interface UID
Anaesthetix 0:978110f7f027 69 *
Anaesthetix 0:978110f7f027 70 * If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00)
Anaesthetix 0:978110f7f027 71 *
Anaesthetix 0:978110f7f027 72 * This is a weak function that can be overwritten if you want to provide your own mechanism to
Anaesthetix 0:978110f7f027 73 * provide a MAC address.
Anaesthetix 0:978110f7f027 74
Anaesthetix 0:978110f7f027 75 * Variables:
Anaesthetix 0:978110f7f027 76 * mac - A 6-byte array to write the MAC address
Anaesthetix 0:978110f7f027 77 */
Anaesthetix 0:978110f7f027 78 void mbed_mac_address(char *mac);
Anaesthetix 0:978110f7f027 79
Anaesthetix 0:978110f7f027 80 /* Function: mbed_die
Anaesthetix 0:978110f7f027 81 * Cause the mbed to flash the BLOD LED sequence
Anaesthetix 0:978110f7f027 82 */
Anaesthetix 0:978110f7f027 83 void mbed_die(void);
Anaesthetix 0:978110f7f027 84
Anaesthetix 0:978110f7f027 85 #ifdef __cplusplus
Anaesthetix 0:978110f7f027 86 }
Anaesthetix 0:978110f7f027 87 #endif
Anaesthetix 0:978110f7f027 88
Anaesthetix 0:978110f7f027 89 #endif