temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

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