BLE temperature profile using digital DS1820 or analog LM35 sensors

Dependencies:   DS1820

Committer:
gkroussos
Date:
Sat Mar 07 16:23:41 2015 +0000
Revision:
0:637031152314
Working version 1.0

Who changed what in which revision?

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