Added to LPC4088-USBHost the USBHostMidi class. Plugin an usb midi interface to the usb host of lpc4088 allows to send midi event to the midi interface. For the moment I can not be able to get event from the interface by using the attacheNoteOn or other triggers...

Dependencies:   FATFileSystem mbed-rtos

Fork of LPC4088-USBHost by Norimasa Okamoto

Committer:
va009039
Date:
Fri Apr 25 05:18:55 2014 +0000
Revision:
0:148fca6fd246
Child:
1:d652de69bd1a
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:148fca6fd246 1 /* mbed USBHost Library
va009039 0:148fca6fd246 2 * Copyright (c) 2006-2013 ARM Limited
va009039 0:148fca6fd246 3 *
va009039 0:148fca6fd246 4 * Licensed under the Apache License, Version 2.0 (the "License");
va009039 0:148fca6fd246 5 * you may not use this file except in compliance with the License.
va009039 0:148fca6fd246 6 * You may obtain a copy of the License at
va009039 0:148fca6fd246 7 *
va009039 0:148fca6fd246 8 * http://www.apache.org/licenses/LICENSE-2.0
va009039 0:148fca6fd246 9 *
va009039 0:148fca6fd246 10 * Unless required by applicable law or agreed to in writing, software
va009039 0:148fca6fd246 11 * distributed under the License is distributed on an "AS IS" BASIS,
va009039 0:148fca6fd246 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
va009039 0:148fca6fd246 13 * See the License for the specific language governing permissions and
va009039 0:148fca6fd246 14 * limitations under the License.
va009039 0:148fca6fd246 15 */
va009039 0:148fca6fd246 16
va009039 0:148fca6fd246 17 #include "USBHost.h"
va009039 0:148fca6fd246 18 #include "BaseUsbHostDebug.h"
va009039 0:148fca6fd246 19 #include "USBEndpoint.h"
va009039 0:148fca6fd246 20 #include "BaseUsbHostTest.h"
va009039 0:148fca6fd246 21
va009039 0:148fca6fd246 22 HCTD* USBEndpoint::get_queue_HCTD(uint32_t millisec)
va009039 0:148fca6fd246 23 {
va009039 0:148fca6fd246 24 for(int i = 0; i < 16; i++) {
va009039 0:148fca6fd246 25 osEvent evt = m_queue.get(millisec);
va009039 0:148fca6fd246 26 if (evt.status == osEventMessage) {
va009039 0:148fca6fd246 27 HCTD* td = reinterpret_cast<HCTD*>(evt.value.p);
va009039 0:148fca6fd246 28 TEST_ASSERT(td);
va009039 0:148fca6fd246 29 uint8_t cc = td->ConditionCode();
va009039 0:148fca6fd246 30 if (cc != 0) {
va009039 0:148fca6fd246 31 m_ConditionCode = cc;
va009039 0:148fca6fd246 32 DBG_TD(td);
va009039 0:148fca6fd246 33 }
va009039 0:148fca6fd246 34 return td;
va009039 0:148fca6fd246 35 } else if (evt.status == osOK) {
va009039 0:148fca6fd246 36 continue;
va009039 0:148fca6fd246 37 } else if (evt.status == osEventTimeout) {
va009039 0:148fca6fd246 38 return NULL;
va009039 0:148fca6fd246 39 } else {
va009039 0:148fca6fd246 40 DBG("evt.status: %02x\n", evt.status);
va009039 0:148fca6fd246 41 TEST_ASSERT(evt.status == osEventMessage);
va009039 0:148fca6fd246 42 }
va009039 0:148fca6fd246 43 }
va009039 0:148fca6fd246 44 return NULL;
va009039 0:148fca6fd246 45 }
va009039 0:148fca6fd246 46
va009039 0:148fca6fd246 47