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