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:
Fri Apr 29 01:16:38 2016 +0100
Revision:
35:f72ccc6892ee
Synchronized with git revision fe9720f24b1adc71ab6962506ec51290f6afd270

Full URL: https://github.com/mbedmicro/mbed/commit/fe9720f24b1adc71ab6962506ec51290f6afd270/

[Renesas RZ/A1H] Enable asynchronous communications

Who changed what in which revision?

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