USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.

Dependencies:   FATFileSystem mbed-rtos

Dependents:   BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Committer:
mbed_official
Date:
Mon Jan 19 14:30:37 2015 +0000
Revision:
27:4206883f4cb7
Synchronized with git revision 0ab8d2e6b3d884137dcb5c62d29a07abe132bac7

Full URL: https://github.com/mbedmicro/mbed/commit/0ab8d2e6b3d884137dcb5c62d29a07abe132bac7/

RZ_A1H - Implement some USB functions and fix some bugs about USBHost common codes.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 27:4206883f4cb7 1 /*******************************************************************************
mbed_official 27:4206883f4cb7 2 * DISCLAIMER
mbed_official 27:4206883f4cb7 3 * This software is supplied by Renesas Electronics Corporation and is only
mbed_official 27:4206883f4cb7 4 * intended for use with Renesas products. No other uses are authorized. This
mbed_official 27:4206883f4cb7 5 * software is owned by Renesas Electronics Corporation and is protected under
mbed_official 27:4206883f4cb7 6 * all applicable laws, including copyright laws.
mbed_official 27:4206883f4cb7 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
mbed_official 27:4206883f4cb7 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
mbed_official 27:4206883f4cb7 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
mbed_official 27:4206883f4cb7 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
mbed_official 27:4206883f4cb7 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
mbed_official 27:4206883f4cb7 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
mbed_official 27:4206883f4cb7 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
mbed_official 27:4206883f4cb7 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
mbed_official 27:4206883f4cb7 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mbed_official 27:4206883f4cb7 16 * Renesas reserves the right, without notice, to make changes to this software
mbed_official 27:4206883f4cb7 17 * and to discontinue the availability of this software. By using this software,
mbed_official 27:4206883f4cb7 18 * you agree to the additional terms and conditions found by accessing the
mbed_official 27:4206883f4cb7 19 * following link:
mbed_official 27:4206883f4cb7 20 * http://www.renesas.com/disclaimer
mbed_official 27:4206883f4cb7 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
mbed_official 27:4206883f4cb7 22 *******************************************************************************/
mbed_official 27:4206883f4cb7 23 /*******************************************************************************
mbed_official 27:4206883f4cb7 24 * File Name : usb0_host_global.c
mbed_official 27:4206883f4cb7 25 * $Rev: 1116 $
mbed_official 27:4206883f4cb7 26 * $Date:: 2014-07-09 16:29:19 +0900#$
mbed_official 27:4206883f4cb7 27 * Device(s) : RZ/A1H
mbed_official 27:4206883f4cb7 28 * Tool-Chain :
mbed_official 27:4206883f4cb7 29 * OS : None
mbed_official 27:4206883f4cb7 30 * H/W Platform :
mbed_official 27:4206883f4cb7 31 * Description : RZ/A1H R7S72100 USB Sample Program
mbed_official 27:4206883f4cb7 32 * Operation :
mbed_official 27:4206883f4cb7 33 * Limitations :
mbed_official 27:4206883f4cb7 34 *******************************************************************************/
mbed_official 27:4206883f4cb7 35
mbed_official 27:4206883f4cb7 36
mbed_official 27:4206883f4cb7 37 /*******************************************************************************
mbed_official 27:4206883f4cb7 38 Includes <System Includes> , "Project Includes"
mbed_official 27:4206883f4cb7 39 *******************************************************************************/
mbed_official 27:4206883f4cb7 40 #include "usb0_host.h"
mbed_official 27:4206883f4cb7 41
mbed_official 27:4206883f4cb7 42
mbed_official 27:4206883f4cb7 43 /*******************************************************************************
mbed_official 27:4206883f4cb7 44 Typedef definitions
mbed_official 27:4206883f4cb7 45 *******************************************************************************/
mbed_official 27:4206883f4cb7 46
mbed_official 27:4206883f4cb7 47
mbed_official 27:4206883f4cb7 48 /*******************************************************************************
mbed_official 27:4206883f4cb7 49 Macro definitions
mbed_official 27:4206883f4cb7 50 *******************************************************************************/
mbed_official 27:4206883f4cb7 51
mbed_official 27:4206883f4cb7 52
mbed_official 27:4206883f4cb7 53 /*******************************************************************************
mbed_official 27:4206883f4cb7 54 Imported global variables and functions (from other files)
mbed_official 27:4206883f4cb7 55 *******************************************************************************/
mbed_official 27:4206883f4cb7 56
mbed_official 27:4206883f4cb7 57
mbed_official 27:4206883f4cb7 58 /*******************************************************************************
mbed_official 27:4206883f4cb7 59 Exported global variables and functions (to be accessed by other files)
mbed_official 27:4206883f4cb7 60 *******************************************************************************/
mbed_official 27:4206883f4cb7 61 const uint16_t g_usb0_host_bit_set[16] =
mbed_official 27:4206883f4cb7 62 {
mbed_official 27:4206883f4cb7 63 0x0001, 0x0002, 0x0004, 0x0008,
mbed_official 27:4206883f4cb7 64 0x0010, 0x0020, 0x0040, 0x0080,
mbed_official 27:4206883f4cb7 65 0x0100, 0x0200, 0x0400, 0x0800,
mbed_official 27:4206883f4cb7 66 0x1000, 0x2000, 0x4000, 0x8000
mbed_official 27:4206883f4cb7 67 };
mbed_official 27:4206883f4cb7 68
mbed_official 27:4206883f4cb7 69 uint32_t g_usb0_host_data_count[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 70 uint8_t * g_usb0_host_data_pointer[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 71
mbed_official 27:4206883f4cb7 72 uint16_t g_usb0_host_PipeIgnore[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 73 uint16_t g_usb0_host_PipeTbl[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 74 uint16_t g_usb0_host_pipe_status[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 75 uint32_t g_usb0_host_PipeDataSize[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 76
mbed_official 27:4206883f4cb7 77 USB_HOST_DMA_t g_usb0_host_DmaInfo[2];
mbed_official 27:4206883f4cb7 78
mbed_official 27:4206883f4cb7 79 uint16_t g_usb0_host_DmaPipe[2];
mbed_official 27:4206883f4cb7 80 uint16_t g_usb0_host_DmaBval[2];
mbed_official 27:4206883f4cb7 81 uint16_t g_usb0_host_DmaStatus[2];
mbed_official 27:4206883f4cb7 82
mbed_official 27:4206883f4cb7 83 uint16_t g_usb0_host_driver_state;
mbed_official 27:4206883f4cb7 84 uint16_t g_usb0_host_ConfigNum;
mbed_official 27:4206883f4cb7 85 uint16_t g_usb0_host_CmdStage;
mbed_official 27:4206883f4cb7 86 uint16_t g_usb0_host_bchg_flag;
mbed_official 27:4206883f4cb7 87 uint16_t g_usb0_host_detach_flag;
mbed_official 27:4206883f4cb7 88 uint16_t g_usb0_host_attach_flag;
mbed_official 27:4206883f4cb7 89
mbed_official 27:4206883f4cb7 90 uint16_t g_usb0_host_UsbAddress;
mbed_official 27:4206883f4cb7 91 uint16_t g_usb0_host_setUsbAddress;
mbed_official 27:4206883f4cb7 92 uint16_t g_usb0_host_default_max_packet[USB_HOST_MAX_DEVICE + 1];
mbed_official 27:4206883f4cb7 93 uint16_t g_usb0_host_UsbDeviceSpeed;
mbed_official 27:4206883f4cb7 94 uint16_t g_usb0_host_SupportUsbDeviceSpeed;
mbed_official 27:4206883f4cb7 95
mbed_official 27:4206883f4cb7 96 uint16_t g_usb0_host_SavReq;
mbed_official 27:4206883f4cb7 97 uint16_t g_usb0_host_SavVal;
mbed_official 27:4206883f4cb7 98 uint16_t g_usb0_host_SavIndx;
mbed_official 27:4206883f4cb7 99 uint16_t g_usb0_host_SavLen;
mbed_official 27:4206883f4cb7 100
mbed_official 27:4206883f4cb7 101 uint16_t g_usb0_host_pipecfg[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 102 uint16_t g_usb0_host_pipebuf[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 103 uint16_t g_usb0_host_pipemaxp[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 104 uint16_t g_usb0_host_pipeperi[USB_HOST_MAX_PIPE_NO + 1];
mbed_official 27:4206883f4cb7 105
mbed_official 27:4206883f4cb7 106
mbed_official 27:4206883f4cb7 107 /*******************************************************************************
mbed_official 27:4206883f4cb7 108 Private global variables and functions
mbed_official 27:4206883f4cb7 109 *******************************************************************************/
mbed_official 27:4206883f4cb7 110
mbed_official 27:4206883f4cb7 111
mbed_official 27:4206883f4cb7 112 /*******************************************************************************
mbed_official 27:4206883f4cb7 113 * Function Name: usb0_host_init_pipe_status
mbed_official 27:4206883f4cb7 114 * Description : Initialize pipe status.
mbed_official 27:4206883f4cb7 115 * Arguments : none
mbed_official 27:4206883f4cb7 116 * Return Value : none
mbed_official 27:4206883f4cb7 117 *******************************************************************************/
mbed_official 27:4206883f4cb7 118 void usb0_host_init_pipe_status (void)
mbed_official 27:4206883f4cb7 119 {
mbed_official 27:4206883f4cb7 120 uint16_t loop;
mbed_official 27:4206883f4cb7 121
mbed_official 27:4206883f4cb7 122 g_usb0_host_ConfigNum = 0;
mbed_official 27:4206883f4cb7 123
mbed_official 27:4206883f4cb7 124 for (loop = 0; loop < (USB_HOST_MAX_PIPE_NO + 1); ++loop)
mbed_official 27:4206883f4cb7 125 {
mbed_official 27:4206883f4cb7 126 g_usb0_host_pipe_status[loop] = USB_HOST_PIPE_IDLE;
mbed_official 27:4206883f4cb7 127 g_usb0_host_PipeDataSize[loop] = 0;
mbed_official 27:4206883f4cb7 128
mbed_official 27:4206883f4cb7 129 /* pipe configuration in usb0_host_resetEP() */
mbed_official 27:4206883f4cb7 130 g_usb0_host_pipecfg[loop] = 0;
mbed_official 27:4206883f4cb7 131 g_usb0_host_pipebuf[loop] = 0;
mbed_official 27:4206883f4cb7 132 g_usb0_host_pipemaxp[loop] = 0;
mbed_official 27:4206883f4cb7 133 g_usb0_host_pipeperi[loop] = 0;
mbed_official 27:4206883f4cb7 134 }
mbed_official 27:4206883f4cb7 135 }
mbed_official 27:4206883f4cb7 136
mbed_official 27:4206883f4cb7 137 /* End of File */