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