source: asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/platform/mbed_interface.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

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