forked for unsupported target

Dependents:   stm32-disco-example DISCO-F469NI_BD_SD_Card_Control

Fork of USBHOST by ST

Committer:
bcjun@aname.co.kr
Date:
Tue Aug 08 16:20:39 2017 +0900
Revision:
7:75f3e275934b
Parent:
1:ab240722d7ef
change usbhost library that forked in my account

Who changed what in which revision?

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