USBHost custom library.
Dependents: GR-PEACH_HVC-P2_sample_client mbed-os-storage-access GR-PEACH_Digital_Signage GR-PEACH_Audio_Playback_Sample ... more
Fork of USBHost by
USBHost/TARGET_RENESAS/TARGET_RZ_A1H/ohci_wrapp_pipe.c@40:cdc0d2ab4678, 2017-03-17 (annotated)
- Committer:
- dkato
- Date:
- Fri Mar 17 01:29:52 2017 +0000
- Revision:
- 40:cdc0d2ab4678
- Parent:
- 32:140defdf151c
Fixed writeBuf transmission size of USBHostSerial class.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 29:d3b77affed28 | 1 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 2 | * DISCLAIMER |
mbed_official | 29:d3b77affed28 | 3 | * This software is supplied by Renesas Electronics Corporation and is only |
mbed_official | 29:d3b77affed28 | 4 | * intended for use with Renesas products. No other uses are authorized. This |
mbed_official | 29:d3b77affed28 | 5 | * software is owned by Renesas Electronics Corporation and is protected under |
mbed_official | 29:d3b77affed28 | 6 | * all applicable laws, including copyright laws. |
mbed_official | 29:d3b77affed28 | 7 | * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING |
mbed_official | 29:d3b77affed28 | 8 | * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT |
mbed_official | 29:d3b77affed28 | 9 | * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE |
mbed_official | 29:d3b77affed28 | 10 | * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. |
mbed_official | 29:d3b77affed28 | 11 | * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS |
mbed_official | 29:d3b77affed28 | 12 | * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE |
mbed_official | 29:d3b77affed28 | 13 | * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR |
mbed_official | 29:d3b77affed28 | 14 | * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE |
mbed_official | 29:d3b77affed28 | 15 | * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
mbed_official | 29:d3b77affed28 | 16 | * Renesas reserves the right, without notice, to make changes to this software |
mbed_official | 29:d3b77affed28 | 17 | * and to discontinue the availability of this software. By using this software, |
mbed_official | 29:d3b77affed28 | 18 | * you agree to the additional terms and conditions found by accessing the |
mbed_official | 29:d3b77affed28 | 19 | * following link: |
mbed_official | 29:d3b77affed28 | 20 | * http://www.renesas.com/disclaimer |
mbed_official | 29:d3b77affed28 | 21 | * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved. |
mbed_official | 29:d3b77affed28 | 22 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 23 | |
mbed_official | 29:d3b77affed28 | 24 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 25 | Includes <System Includes> , "Project Includes" |
mbed_official | 29:d3b77affed28 | 26 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 27 | #include "devdrv_usb_host_api.h" |
mbed_official | 29:d3b77affed28 | 28 | |
mbed_official | 29:d3b77affed28 | 29 | |
mbed_official | 29:d3b77affed28 | 30 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 31 | Typedef definitions |
mbed_official | 29:d3b77affed28 | 32 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 33 | |
mbed_official | 29:d3b77affed28 | 34 | |
mbed_official | 29:d3b77affed28 | 35 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 36 | Macro definitions |
mbed_official | 29:d3b77affed28 | 37 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 38 | |
mbed_official | 29:d3b77affed28 | 39 | |
mbed_official | 29:d3b77affed28 | 40 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 41 | Imported global variables and functions (from other files) |
mbed_official | 29:d3b77affed28 | 42 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 43 | |
mbed_official | 29:d3b77affed28 | 44 | |
mbed_official | 29:d3b77affed28 | 45 | /******************************************************************************* |
mbed_official | 29:d3b77affed28 | 46 | Exported global variables and functions (to be accessed by other files) |
mbed_official | 29:d3b77affed28 | 47 | *******************************************************************************/ |
mbed_official | 29:d3b77affed28 | 48 | |
mbed_official | 29:d3b77affed28 | 49 | |
mbed_official | 29:d3b77affed28 | 50 | /********************************************************************************************************/ |
mbed_official | 29:d3b77affed28 | 51 | /* Endpoint Configuration Data Format */ |
mbed_official | 29:d3b77affed28 | 52 | /********************************************************************************************************/ |
mbed_official | 29:d3b77affed28 | 53 | /* LINE1: Pipe Window Select Register */ |
mbed_official | 32:140defdf151c | 54 | /* CPU Access PIPE : USB_HOST_PIPE1 to USB_HOST_PIPE9 [ ### SET ### ] */ |
mbed_official | 29:d3b77affed28 | 55 | /* LINE2: Pipe Configuration Register */ |
mbed_official | 29:d3b77affed28 | 56 | /* Transfer Type : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 57 | /* Buffer Ready interrupt : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 32:140defdf151c | 58 | /* Double Buffer Mode : USB_HOST_DBLBON / USB_HOST_DBLBOFF [ ### SET ### ] */ |
mbed_official | 32:140defdf151c | 59 | /* Continuous Transmit: : USB_HOST_CNTMDON / USB_HOST_CNTMDOFF [ ### SET ### ] */ |
mbed_official | 29:d3b77affed28 | 60 | /* Short NAK : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 61 | /* Transfer Direction : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 62 | /* Endpoint Number : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 63 | /* LINE3: Pipe Buffer Configuration Register */ |
mbed_official | 29:d3b77affed28 | 64 | /* Buffer Size : (uint16_t)((uint16_t)(((x) / 64) - 1) << 10) */ |
mbed_official | 29:d3b77affed28 | 65 | /* [ ### SET ### ] */ |
mbed_official | 29:d3b77affed28 | 66 | /* Buffer Top Number : (uint16_t)(x) [ ### SET ### ] */ |
mbed_official | 29:d3b77affed28 | 67 | /* LINE4: Pipe Maxpacket Size Register */ |
mbed_official | 29:d3b77affed28 | 68 | /* Max Packet Size : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 69 | /* LINE5: Pipe Cycle Configuration Register (0x6C) */ |
mbed_official | 29:d3b77affed28 | 70 | /* ISO Buffer Flush Mode : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 71 | /* ISO Interval Value : USB_HOST_NONE [ USB_HOST_NONE ] */ |
mbed_official | 29:d3b77affed28 | 72 | /* LINE6: use FIFO port */ |
mbed_official | 29:d3b77affed28 | 73 | /* : USB_HOST_CUSE [ ### SET ### ] */ |
mbed_official | 29:d3b77affed28 | 74 | /* : USB_HOST_D0USE / USB_HOST_D1USE */ |
mbed_official | 32:140defdf151c | 75 | /* : USB_HOST_D0DMA / USB_HOST_D0DMA */ |
mbed_official | 29:d3b77affed28 | 76 | /********************************************************************************************************/ |
mbed_official | 29:d3b77affed28 | 77 | |
mbed_official | 29:d3b77affed28 | 78 | /* Device Address 1 */ |
mbed_official | 29:d3b77affed28 | 79 | USB_HOST_CFG_PIPETBL_t usb_host_blk_ep_tbl1[ ] = |
mbed_official | 29:d3b77affed28 | 80 | { |
mbed_official | 29:d3b77affed28 | 81 | { |
mbed_official | 29:d3b77affed28 | 82 | USB_HOST_PIPE3, |
mbed_official | 29:d3b77affed28 | 83 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 29:d3b77affed28 | 84 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 85 | (uint16_t)((uint16_t)(((1024) / 64) - 1) << 10) | (uint16_t)(8), |
mbed_official | 29:d3b77affed28 | 86 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 87 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 88 | USB_HOST_D0USE |
mbed_official | 29:d3b77affed28 | 89 | }, |
mbed_official | 29:d3b77affed28 | 90 | |
mbed_official | 29:d3b77affed28 | 91 | { |
mbed_official | 29:d3b77affed28 | 92 | /* Pipe end */ |
mbed_official | 29:d3b77affed28 | 93 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 94 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 95 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 96 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 97 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 98 | 0xFFFF |
mbed_official | 29:d3b77affed28 | 99 | } |
mbed_official | 29:d3b77affed28 | 100 | }; |
mbed_official | 29:d3b77affed28 | 101 | |
mbed_official | 29:d3b77affed28 | 102 | USB_HOST_CFG_PIPETBL_t usb_host_int_ep_tbl1[ ] = |
mbed_official | 29:d3b77affed28 | 103 | { |
mbed_official | 29:d3b77affed28 | 104 | { |
mbed_official | 29:d3b77affed28 | 105 | USB_HOST_PIPE6, |
mbed_official | 29:d3b77affed28 | 106 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 107 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBOFF | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 108 | (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(40), |
mbed_official | 29:d3b77affed28 | 109 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 110 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 111 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 112 | }, |
mbed_official | 29:d3b77affed28 | 113 | |
mbed_official | 29:d3b77affed28 | 114 | { |
mbed_official | 29:d3b77affed28 | 115 | USB_HOST_PIPE7, |
mbed_official | 29:d3b77affed28 | 116 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 117 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBOFF | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 118 | (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(41), |
mbed_official | 29:d3b77affed28 | 119 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 120 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 121 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 122 | }, |
mbed_official | 29:d3b77affed28 | 123 | |
mbed_official | 29:d3b77affed28 | 124 | { |
mbed_official | 29:d3b77affed28 | 125 | USB_HOST_PIPE8, |
mbed_official | 29:d3b77affed28 | 126 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 127 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBOFF | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 128 | (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(42), |
mbed_official | 29:d3b77affed28 | 129 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 130 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 131 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 132 | }, |
mbed_official | 29:d3b77affed28 | 133 | |
mbed_official | 29:d3b77affed28 | 134 | { |
mbed_official | 29:d3b77affed28 | 135 | USB_HOST_PIPE9, |
mbed_official | 29:d3b77affed28 | 136 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 137 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBOFF | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 138 | (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(43), |
mbed_official | 29:d3b77affed28 | 139 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 140 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 141 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 142 | }, |
mbed_official | 29:d3b77affed28 | 143 | |
mbed_official | 29:d3b77affed28 | 144 | { |
mbed_official | 29:d3b77affed28 | 145 | /* Pipe end */ |
mbed_official | 29:d3b77affed28 | 146 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 147 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 148 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 149 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 150 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 151 | 0xFFFF |
mbed_official | 29:d3b77affed28 | 152 | } |
mbed_official | 29:d3b77affed28 | 153 | }; |
mbed_official | 29:d3b77affed28 | 154 | |
mbed_official | 29:d3b77affed28 | 155 | USB_HOST_CFG_PIPETBL_t usb_host_iso_ep_tbl1[ ] = |
mbed_official | 29:d3b77affed28 | 156 | { |
mbed_official | 29:d3b77affed28 | 157 | { |
mbed_official | 29:d3b77affed28 | 158 | USB_HOST_PIPE1, |
mbed_official | 29:d3b77affed28 | 159 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 160 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 161 | (uint16_t)((uint16_t)(((1024) / 64) - 1) << 10) | (uint16_t)(44), |
mbed_official | 29:d3b77affed28 | 162 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 163 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 164 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 165 | }, |
mbed_official | 29:d3b77affed28 | 166 | |
mbed_official | 29:d3b77affed28 | 167 | { |
mbed_official | 29:d3b77affed28 | 168 | USB_HOST_PIPE2, |
mbed_official | 29:d3b77affed28 | 169 | /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */ |
mbed_official | 32:140defdf151c | 170 | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDOFF | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE, |
mbed_official | 32:140defdf151c | 171 | (uint16_t)((uint16_t)(((1024) / 64) - 1) << 10) | (uint16_t)(76), |
mbed_official | 29:d3b77affed28 | 172 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 173 | USB_HOST_NONE, |
mbed_official | 29:d3b77affed28 | 174 | USB_HOST_D1USE |
mbed_official | 29:d3b77affed28 | 175 | }, |
mbed_official | 29:d3b77affed28 | 176 | |
mbed_official | 29:d3b77affed28 | 177 | { |
mbed_official | 29:d3b77affed28 | 178 | /* Pipe end */ |
mbed_official | 29:d3b77affed28 | 179 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 180 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 181 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 182 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 183 | 0xFFFF, |
mbed_official | 29:d3b77affed28 | 184 | 0xFFFF |
mbed_official | 29:d3b77affed28 | 185 | } |
mbed_official | 29:d3b77affed28 | 186 | }; |
mbed_official | 29:d3b77affed28 | 187 | |
mbed_official | 29:d3b77affed28 | 188 | |
mbed_official | 29:d3b77affed28 | 189 | /* End of File */ |