Adaptation of the official mbed USBHost repository to work with the LPC4088 Display Module
Dependents: DMSupport DMSupport DMSupport DMSupport
Fork of DM_USBHost by
USBHost/dbg.h@27:aa2fd412f1d3, 2014-12-02 (annotated)
- Committer:
- embeddedartists
- Date:
- Tue Dec 02 15:16:39 2014 +0000
- Revision:
- 27:aa2fd412f1d3
- Parent:
- 19:bd46ea19486b
Adaptation of the official mbed USBHost repository to work with the LPC4088 Display Module. The changes include: basic setup, move of all memory to the AHBSRAM0, switch to USB port 2, adding a memory allocator for users.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 8:93da8ea2708b | 1 | /* mbed USBHost Library |
samux | 8:93da8ea2708b | 2 | * Copyright (c) 2006-2013 ARM Limited |
samux | 8:93da8ea2708b | 3 | * |
samux | 8:93da8ea2708b | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
samux | 8:93da8ea2708b | 5 | * you may not use this file except in compliance with the License. |
samux | 8:93da8ea2708b | 6 | * You may obtain a copy of the License at |
samux | 8:93da8ea2708b | 7 | * |
samux | 8:93da8ea2708b | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
samux | 8:93da8ea2708b | 9 | * |
samux | 8:93da8ea2708b | 10 | * Unless required by applicable law or agreed to in writing, software |
samux | 8:93da8ea2708b | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
samux | 8:93da8ea2708b | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
samux | 8:93da8ea2708b | 13 | * See the License for the specific language governing permissions and |
samux | 8:93da8ea2708b | 14 | * limitations under the License. |
samux | 8:93da8ea2708b | 15 | */ |
emilmont | 11:0e0baf9a3236 | 16 | |
mbed_official | 0:a554658735bf | 17 | #ifndef USB_DEBUG_H |
mbed_official | 0:a554658735bf | 18 | #define USB_DEBUG_H |
mbed_official | 0:a554658735bf | 19 | |
embeddedartists | 27:aa2fd412f1d3 | 20 | #include "DMBoard.h" // To replace the std::printf calls |
embeddedartists | 27:aa2fd412f1d3 | 21 | |
mbed_official | 0:a554658735bf | 22 | //Debug is disabled by default |
embeddedartists | 27:aa2fd412f1d3 | 23 | #define DEBUG 2 /*ERR,WARN*/ |
mbed_official | 0:a554658735bf | 24 | #define DEBUG_TRANSFER 0 |
mbed_official | 0:a554658735bf | 25 | #define DEBUG_EP_STATE 0 |
mbed_official | 0:a554658735bf | 26 | #define DEBUG_EVENT 0 |
mbed_official | 0:a554658735bf | 27 | |
mbed_official | 19:bd46ea19486b | 28 | #if (DEBUG > 3) |
embeddedartists | 27:aa2fd412f1d3 | 29 | #define USB_DBG(x, ...) DMBoard::instance().logger()->printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
embeddedartists | 27:aa2fd412f1d3 | 30 | #define USB_DBG_X(...) DMBoard::instance().logger()->printf(__VA_ARGS__) |
mbed_official | 0:a554658735bf | 31 | #else |
mbed_official | 0:a554658735bf | 32 | #define USB_DBG(x, ...) |
mbed_official | 0:a554658735bf | 33 | #endif |
mbed_official | 0:a554658735bf | 34 | |
mbed_official | 19:bd46ea19486b | 35 | #if (DEBUG > 2) |
embeddedartists | 27:aa2fd412f1d3 | 36 | #define USB_INFO(x, ...) DMBoard::instance().logger()->printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
mbed_official | 19:bd46ea19486b | 37 | #else |
mbed_official | 19:bd46ea19486b | 38 | #define USB_INFO(x, ...) |
mbed_official | 19:bd46ea19486b | 39 | #endif |
mbed_official | 19:bd46ea19486b | 40 | |
mbed_official | 19:bd46ea19486b | 41 | #if (DEBUG > 1) |
embeddedartists | 27:aa2fd412f1d3 | 42 | #define USB_WARN(x, ...) DMBoard::instance().logger()->printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
mbed_official | 19:bd46ea19486b | 43 | #else |
mbed_official | 19:bd46ea19486b | 44 | #define USB_WARN(x, ...) |
mbed_official | 19:bd46ea19486b | 45 | #endif |
mbed_official | 19:bd46ea19486b | 46 | |
mbed_official | 19:bd46ea19486b | 47 | #if (DEBUG > 0) |
embeddedartists | 27:aa2fd412f1d3 | 48 | #define USB_ERR(x, ...) DMBoard::instance().logger()->printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
mbed_official | 19:bd46ea19486b | 49 | #else |
mbed_official | 19:bd46ea19486b | 50 | #define USB_ERR(x, ...) |
mbed_official | 19:bd46ea19486b | 51 | #endif |
mbed_official | 19:bd46ea19486b | 52 | |
mbed_official | 0:a554658735bf | 53 | #if (DEBUG_TRANSFER) |
embeddedartists | 27:aa2fd412f1d3 | 54 | #define USB_DBG_TRANSFER(x, ...) DMBoard::instance().logger()->printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
mbed_official | 0:a554658735bf | 55 | #else |
mbed_official | 0:a554658735bf | 56 | #define USB_DBG_TRANSFER(x, ...) |
mbed_official | 0:a554658735bf | 57 | #endif |
mbed_official | 0:a554658735bf | 58 | |
mbed_official | 0:a554658735bf | 59 | #if (DEBUG_EVENT) |
embeddedartists | 27:aa2fd412f1d3 | 60 | #define USB_DBG_EVENT(x, ...) DMBoard::instance().logger()->printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) |
mbed_official | 0:a554658735bf | 61 | #else |
mbed_official | 0:a554658735bf | 62 | #define USB_DBG_EVENT(x, ...) |
mbed_official | 0:a554658735bf | 63 | #endif |
mbed_official | 0:a554658735bf | 64 | |
mbed_official | 0:a554658735bf | 65 | |
embeddedartists | 27:aa2fd412f1d3 | 66 | void assert_mem_region(uint32_t ptr); |
embeddedartists | 27:aa2fd412f1d3 | 67 | #define ASSERT_MEM_REGION(__x) assert_mem_region((uint32_t)(__x)) |
embeddedartists | 27:aa2fd412f1d3 | 68 | |
mbed_official | 0:a554658735bf | 69 | #endif |
mbed_official | 0:a554658735bf | 70 |