mbed library sources with internal temperature sensor for nucleo f401

Committer:
elessair
Date:
Sat Jan 17 18:03:58 2015 +0000
Revision:
0:7e2bd16f80af
nucleo f401re internal temperature added

Who changed what in which revision?

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