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