forked for unsupported target
Dependents: stm32-disco-example DISCO-F469NI_BD_SD_Card_Control
Fork of USBHOST by
USBHost/TARGET_RENESAS/TARGET_RZ_A1H/usb0/src/common/usb0_host_lib.c@7:75f3e275934b, 2017-08-08 (annotated)
- 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?
User | Revision | Line number | New 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 : usb0_host_lib.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 "usb0_host.h" |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 41 | #if(1) /* ohci_wrapp */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 42 | #include "MBRZA1H.h" /* INTC Driver Header */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 43 | #else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 44 | #include "devdrv_intc.h" /* INTC Driver Header */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 45 | #endif |
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 | Typedef 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 | Macro definitions |
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 | Imported global variables and functions (from other files) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 60 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 61 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 62 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 63 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 64 | Exported global variables and functions (to be accessed by other files) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 65 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 66 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 67 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 68 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 69 | Private global variables and functions |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 70 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 71 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 72 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 73 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 74 | * Function Name: usb0_host_enable_brdy_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 75 | * Description : Enables BRDY interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 76 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before enabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 77 | * : BRDY. Enables BRDY interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 78 | * : in the disabled status. After enabling BRDY, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 79 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 80 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 81 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 82 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 83 | void usb0_host_enable_brdy_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 84 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 85 | /* enable brdy interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 86 | USB200.BRDYENB |= (uint16_t)g_usb0_host_bit_set[pipe]; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 87 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 88 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 89 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 90 | * Function Name: usb0_host_disable_brdy_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 91 | * Description : Disables BRDY interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 92 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before disabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 93 | * : BRDY. Enables BRDY interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 94 | * : in the disabled status. After disabling BRDY, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 95 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 96 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 97 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 98 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 99 | void usb0_host_disable_brdy_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 100 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 101 | /* disable brdy interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 102 | USB200.BRDYENB &= (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 103 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 104 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 105 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 106 | * Function Name: usb0_host_clear_brdy_sts |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 107 | * Description : Clear BRDY interrupt status in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 108 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 109 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 110 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 111 | void usb0_host_clear_brdy_sts (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 112 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 113 | /* clear brdy status */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 114 | USB200.BRDYSTS = (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 115 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 116 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 117 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 118 | * Function Name: usb0_host_enable_bemp_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 119 | * Description : Enables BEMP interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 120 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before enabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 121 | * : BEMP. Enables BEMP interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 122 | * : in the disabled status. After enabling BEMP, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 123 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 124 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 125 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 126 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 127 | void usb0_host_enable_bemp_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 128 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 129 | /* enable bemp interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 130 | USB200.BEMPENB |= (uint16_t)g_usb0_host_bit_set[pipe]; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 131 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 132 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 133 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 134 | * Function Name: usb0_host_disable_bemp_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 135 | * Description : Disables BEMP interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 136 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before disabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 137 | * : BEMP. Enables BEMP interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 138 | * : in the disabled status. After enabling BEMP, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 139 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 140 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 141 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 142 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 143 | void usb0_host_disable_bemp_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 144 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 145 | /* disable bemp interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 146 | USB200.BEMPENB &= (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 147 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 148 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 149 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 150 | * Function Name: usb0_host_clear_bemp_sts |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 151 | * Description : Clear BEMP interrupt status in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 152 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 153 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 154 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 155 | void usb0_host_clear_bemp_sts (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 156 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 157 | /* clear bemp status */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 158 | USB200.BEMPSTS = (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 159 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 160 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 161 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 162 | * Function Name: usb0_host_enable_nrdy_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 163 | * Description : Enables NRDY interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 164 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before enabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 165 | * : NRDY. Enables NRDY interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 166 | * : in the disabled status. After enabling NRDY, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 167 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 168 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 169 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 170 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 171 | void usb0_host_enable_nrdy_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 172 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 173 | /* enable nrdy interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 174 | USB200.NRDYENB |= (uint16_t)g_usb0_host_bit_set[pipe]; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 175 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 176 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 177 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 178 | * Function Name: usb0_host_disable_nrdy_int |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 179 | * Description : Disables NRDY interrupt in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 180 | * : Disables BEMP/NRDY/BRDY interrupts in all pipes before disabling |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 181 | * : NRDY. Disables NRDY interrupt in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 182 | * : in the disabled status. After disabling NRDY, recover all |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 183 | * : BEMP/NRDY/BRDY disabled/enabled status. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 184 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 185 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 186 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 187 | void usb0_host_disable_nrdy_int (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 188 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 189 | /* disable nrdy interrupt */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 190 | USB200.NRDYENB &= (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 191 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 192 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 193 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 194 | * Function Name: usb0_host_clear_nrdy_sts |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 195 | * Description : Clear NRDY interrupt status in the pipe spceified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 196 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 197 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 198 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 199 | void usb0_host_clear_nrdy_sts (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 200 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 201 | /* clear nrdy status */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 202 | USB200.NRDYSTS = (uint16_t)~(g_usb0_host_bit_set[pipe]); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 203 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 204 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 205 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 206 | * Function Name: usb0_host_is_hispeed |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 207 | * Description : Returns the result of USB reset hand shake (RHST) as |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 208 | * : return value. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 209 | * Arguments : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 210 | * Return Value : USB_HOST_HIGH_SPEED ; Hi-Speed |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 211 | * : USB_HOST_FULL_SPEED ; Full-Speed |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 212 | * : USB_HOST_LOW_SPEED ; Low-Speed |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 213 | * : USB_HOST_NON_SPEED ; error |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 214 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 215 | uint16_t usb0_host_is_hispeed (void) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 216 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 217 | uint16_t rhst; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 218 | uint16_t speed; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 219 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 220 | rhst = RZA_IO_RegRead_16(&USB200.DVSTCTR0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 221 | USB_DVSTCTR0_RHST_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 222 | USB_DVSTCTR0_RHST); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 223 | if (rhst == USB_HOST_HSMODE) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 224 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 225 | speed = USB_HOST_HIGH_SPEED; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 226 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 227 | else if (rhst == USB_HOST_FSMODE) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 228 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 229 | speed = USB_HOST_FULL_SPEED; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 230 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 231 | else if (rhst == USB_HOST_LSMODE) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 232 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 233 | speed = USB_HOST_LOW_SPEED; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 234 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 235 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 236 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 237 | speed = USB_HOST_NON_SPEED; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 238 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 239 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 240 | return speed; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 241 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 242 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 243 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 244 | * Function Name: usb0_host_is_hispeed_enable |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 245 | * Description : Returns the USB High-Speed connection enabled status as |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 246 | * : return value. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 247 | * Arguments : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 248 | * Return Value : USB_HOST_YES : Hi-Speed Enable |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 249 | * : USB_HOST_NO : Hi-Speed Disable |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 250 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 251 | uint16_t usb0_host_is_hispeed_enable (void) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 252 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 253 | uint16_t ret; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 254 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 255 | ret = USB_HOST_NO; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 256 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 257 | if (RZA_IO_RegRead_16(&USB200.SYSCFG0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 258 | USB_SYSCFG_HSE_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 259 | USB_SYSCFG_HSE) == 1) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 260 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 261 | ret = USB_HOST_YES; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 262 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 263 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 264 | return ret; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 265 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 266 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 267 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 268 | * Function Name: usb0_host_set_pid_buf |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 269 | * Description : Enables communicaqtion in the pipe specified by the argument |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 270 | * : (BUF). |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 271 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 272 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 273 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 274 | void usb0_host_set_pid_buf (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 275 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 276 | uint16_t pid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 277 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 278 | pid = usb0_host_get_pid(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 279 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 280 | if (pid == USB_HOST_PID_STALL2) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 281 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 282 | usb0_host_set_pid_nak(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 283 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 284 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 285 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 286 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 287 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 288 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 289 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 290 | USB_DCPCTR_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 291 | USB_DCPCTR_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 292 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 293 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 294 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 295 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 296 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 297 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 298 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 299 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 300 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 301 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 302 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 303 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 304 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 305 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 306 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 307 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 308 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 309 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 310 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 311 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 312 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 313 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 314 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 315 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 316 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 317 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 318 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 319 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 320 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 321 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 322 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 323 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 324 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 325 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 326 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 327 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 328 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 329 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 330 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 331 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 332 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 333 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 334 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 335 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 336 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 337 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 338 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 339 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 340 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 341 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 342 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 343 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 344 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 345 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 346 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 347 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 348 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 349 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 350 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 351 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 352 | USB_HOST_PID_BUF, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 353 | USB_PIPEnCTR_9_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 354 | USB_PIPEnCTR_9_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 355 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 356 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 357 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 358 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 359 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 360 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 361 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 362 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 363 | * Function Name: usb0_host_set_pid_nak |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 364 | * Description : Disables communication (NAK) in the pipe specified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 365 | * : When the pipe status was enabling communication (BUF) before |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 366 | * : executing before executing this function, waits in the software |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 367 | * : until the pipe becomes ready after setting disabled. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 368 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 369 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 370 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 371 | void usb0_host_set_pid_nak (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 372 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 373 | uint16_t pid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 374 | uint16_t pbusy; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 375 | uint32_t loop; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 376 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 377 | pid = usb0_host_get_pid(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 378 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 379 | if (pid == USB_HOST_PID_STALL2) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 380 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 381 | usb0_host_set_pid_stall(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 382 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 383 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 384 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 385 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 386 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 387 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 388 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 389 | USB_DCPCTR_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 390 | USB_DCPCTR_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 391 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 392 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 393 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 394 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 395 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 396 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 397 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 398 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 399 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 400 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 401 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 402 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 403 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 404 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 405 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 406 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 407 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 408 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 409 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 410 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 411 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 412 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 413 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 414 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 415 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 416 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 417 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 418 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 419 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 420 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 421 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 422 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 423 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 424 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 425 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 426 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 427 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 428 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 429 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 430 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 431 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 432 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 433 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 434 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 435 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 436 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 437 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 438 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 439 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 440 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 441 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 442 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 443 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 444 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 445 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 446 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 447 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 448 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 449 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 450 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 451 | USB_HOST_PID_NAK, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 452 | USB_PIPEnCTR_9_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 453 | USB_PIPEnCTR_9_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 454 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 455 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 456 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 457 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 458 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 459 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 460 | if (pid == USB_HOST_PID_BUF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 461 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 462 | for (loop = 0; loop < 200; loop++) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 463 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 464 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 465 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 466 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 467 | pbusy = RZA_IO_RegRead_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 468 | USB_DCPCTR_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 469 | USB_DCPCTR_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 470 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 471 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 472 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 473 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 474 | USB_PIPEnCTR_1_5_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 475 | USB_PIPEnCTR_1_5_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 476 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 477 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 478 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 479 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 480 | USB_PIPEnCTR_1_5_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 481 | USB_PIPEnCTR_1_5_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 482 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 483 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 484 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 485 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 486 | USB_PIPEnCTR_1_5_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 487 | USB_PIPEnCTR_1_5_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 488 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 489 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 490 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 491 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 492 | USB_PIPEnCTR_1_5_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 493 | USB_PIPEnCTR_1_5_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 494 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 495 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 496 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 497 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 498 | USB_PIPEnCTR_1_5_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 499 | USB_PIPEnCTR_1_5_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 500 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 501 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 502 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 503 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 504 | USB_PIPEnCTR_6_8_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 505 | USB_PIPEnCTR_6_8_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 506 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 507 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 508 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 509 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 510 | USB_PIPEnCTR_6_8_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 511 | USB_PIPEnCTR_6_8_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 512 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 513 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 514 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 515 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 516 | USB_PIPEnCTR_6_8_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 517 | USB_PIPEnCTR_6_8_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 518 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 519 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 520 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 521 | pbusy = RZA_IO_RegRead_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 522 | USB_PIPEnCTR_9_PBUSY_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 523 | USB_PIPEnCTR_9_PBUSY); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 524 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 525 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 526 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 527 | pbusy = 1; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 528 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 529 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 530 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 531 | if (pbusy == 0) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 532 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 533 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 534 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 535 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 536 | Userdef_USB_usb0_host_delay_500ns(); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 537 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 538 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 539 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 540 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 541 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 542 | * Function Name: usb0_host_set_pid_stall |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 543 | * Description : Disables communication (STALL) in the pipe specified by the |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 544 | * : argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 545 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 546 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 547 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 548 | void usb0_host_set_pid_stall (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 549 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 550 | uint16_t pid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 551 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 552 | pid = usb0_host_get_pid(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 553 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 554 | if (pid == USB_HOST_PID_BUF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 555 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 556 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 557 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 558 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 559 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 560 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 561 | USB_DCPCTR_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 562 | USB_DCPCTR_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 563 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 564 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 565 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 566 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 567 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 568 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 569 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 570 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 571 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 572 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 573 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 574 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 575 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 576 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 577 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 578 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 579 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 580 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 581 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 582 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 583 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 584 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 585 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 586 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 587 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 588 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 589 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 590 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 591 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 592 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 593 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 594 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 595 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 596 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 597 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 598 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 599 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 600 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 601 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 602 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 603 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 604 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 605 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 606 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 607 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 608 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 609 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 610 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 611 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 612 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 613 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 614 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 615 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 616 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 617 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 618 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 619 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 620 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 621 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 622 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 623 | USB_HOST_PID_STALL2, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 624 | USB_PIPEnCTR_9_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 625 | USB_PIPEnCTR_9_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 626 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 627 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 628 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 629 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 630 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 631 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 632 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 633 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 634 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 635 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 636 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 637 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 638 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 639 | USB_DCPCTR_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 640 | USB_DCPCTR_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 641 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 642 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 643 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 644 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 645 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 646 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 647 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 648 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 649 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 650 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 651 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 652 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 653 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 654 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 655 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 656 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 657 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 658 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 659 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 660 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 661 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 662 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 663 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 664 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 665 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 666 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 667 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 668 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 669 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 670 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 671 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 672 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 673 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 674 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 675 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 676 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 677 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 678 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 679 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 680 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 681 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 682 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 683 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 684 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 685 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 686 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 687 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 688 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 689 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 690 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 691 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 692 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 693 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 694 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 695 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 696 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 697 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 698 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 699 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 700 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 701 | USB_HOST_PID_STALL, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 702 | USB_PIPEnCTR_9_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 703 | USB_PIPEnCTR_9_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 704 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 705 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 706 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 707 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 708 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 709 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 710 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 711 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 712 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 713 | * Function Name: usb0_host_clear_pid_stall |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 714 | * Description : Disables communication (NAK) in the pipe specified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 715 | * Arguments : uint16_t pipe ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 716 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 717 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 718 | void usb0_host_clear_pid_stall (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 719 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 720 | usb0_host_set_pid_nak(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 721 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 722 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 723 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 724 | * Function Name: usb0_host_get_pid |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 725 | * Description : Returns the pipe state specified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 726 | * Arguments : uint16_t pipe ; Pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 727 | * Return Value : PID |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 728 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 729 | uint16_t usb0_host_get_pid (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 730 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 731 | uint16_t pid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 732 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 733 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 734 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 735 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 736 | pid = RZA_IO_RegRead_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 737 | USB_DCPCTR_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 738 | USB_DCPCTR_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 739 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 740 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 741 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 742 | pid = RZA_IO_RegRead_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 743 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 744 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 745 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 746 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 747 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 748 | pid = RZA_IO_RegRead_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 749 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 750 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 751 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 752 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 753 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 754 | pid = RZA_IO_RegRead_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 755 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 756 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 757 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 758 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 759 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 760 | pid = RZA_IO_RegRead_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 761 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 762 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 763 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 764 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 765 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 766 | pid = RZA_IO_RegRead_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 767 | USB_PIPEnCTR_1_5_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 768 | USB_PIPEnCTR_1_5_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 769 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 770 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 771 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 772 | pid = RZA_IO_RegRead_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 773 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 774 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 775 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 776 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 777 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 778 | pid = RZA_IO_RegRead_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 779 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 780 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 781 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 782 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 783 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 784 | pid = RZA_IO_RegRead_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 785 | USB_PIPEnCTR_6_8_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 786 | USB_PIPEnCTR_6_8_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 787 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 788 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 789 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 790 | pid = RZA_IO_RegRead_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 791 | USB_PIPEnCTR_9_PID_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 792 | USB_PIPEnCTR_9_PID); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 793 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 794 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 795 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 796 | pid = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 797 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 798 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 799 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 800 | return pid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 801 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 802 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 803 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 804 | * Function Name: usb0_host_set_csclr |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 805 | * Description : CSPLIT status clear setting of sprit transaction in specified |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 806 | * : pipe is performed. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 807 | * : When SQSET bit or SQCLR bit, and SQSET bit or SQCLR bit |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 808 | * : in DCPCTR register are continuously changed (when the sequence |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 809 | * : toggle bit of data PID is continuously changed over two or more pipes), |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 810 | * : the access cycle with 120 ns and more than 5 cycle bus clock is necessary. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 811 | * : Do not set both SQCLR bit and SQSET bit to 1 at the same time. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 812 | * : In addition, both bits should be operated after PID is set to NAK. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 813 | * : However, when it is set to the isochronous transfer as the transfer type |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 814 | * : (TYPE=11), writing in SQSET bit is disabled. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 815 | * Arguments : uint16_t pipe ; Pipe number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 816 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 817 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 818 | void usb0_host_set_csclr (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 819 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 820 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 821 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 822 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 823 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 824 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 825 | USB_DCPCTR_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 826 | USB_DCPCTR_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 827 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 828 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 829 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 830 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 831 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 832 | USB_PIPEnCTR_1_5_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 833 | USB_PIPEnCTR_1_5_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 834 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 835 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 836 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 837 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 838 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 839 | USB_PIPEnCTR_1_5_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 840 | USB_PIPEnCTR_1_5_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 841 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 842 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 843 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 844 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 845 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 846 | USB_PIPEnCTR_1_5_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 847 | USB_PIPEnCTR_1_5_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 848 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 849 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 850 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 851 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 852 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 853 | USB_PIPEnCTR_1_5_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 854 | USB_PIPEnCTR_1_5_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 855 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 856 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 857 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 858 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 859 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 860 | USB_PIPEnCTR_1_5_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 861 | USB_PIPEnCTR_1_5_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 862 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 863 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 864 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 865 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 866 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 867 | USB_PIPEnCTR_6_8_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 868 | USB_PIPEnCTR_6_8_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 869 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 870 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 871 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 872 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 873 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 874 | USB_PIPEnCTR_6_8_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 875 | USB_PIPEnCTR_6_8_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 876 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 877 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 878 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 879 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 880 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 881 | USB_PIPEnCTR_6_8_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 882 | USB_PIPEnCTR_6_8_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 883 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 884 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 885 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 886 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 887 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 888 | USB_PIPEnCTR_9_CSCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 889 | USB_PIPEnCTR_9_CSCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 890 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 891 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 892 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 893 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 894 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 895 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 896 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 897 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 898 | * Function Name: usb0_host_set_sqclr |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 899 | * Description : Sets the sequence bit of the pipe specified by the argument to |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 900 | * : DATA0. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 901 | * Arguments : uint16_t pipe ; Pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 902 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 903 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 904 | void usb0_host_set_sqclr (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 905 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 906 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 907 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 908 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 909 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 910 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 911 | USB_DCPCTR_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 912 | USB_DCPCTR_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 913 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 914 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 915 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 916 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 917 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 918 | USB_PIPEnCTR_1_5_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 919 | USB_PIPEnCTR_1_5_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 920 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 921 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 922 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 923 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 924 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 925 | USB_PIPEnCTR_1_5_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 926 | USB_PIPEnCTR_1_5_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 927 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 928 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 929 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 930 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 931 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 932 | USB_PIPEnCTR_1_5_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 933 | USB_PIPEnCTR_1_5_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 934 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 935 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 936 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 937 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 938 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 939 | USB_PIPEnCTR_1_5_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 940 | USB_PIPEnCTR_1_5_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 941 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 942 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 943 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 944 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 945 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 946 | USB_PIPEnCTR_1_5_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 947 | USB_PIPEnCTR_1_5_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 948 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 949 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 950 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 951 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 952 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 953 | USB_PIPEnCTR_6_8_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 954 | USB_PIPEnCTR_6_8_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 955 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 956 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 957 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 958 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 959 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 960 | USB_PIPEnCTR_6_8_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 961 | USB_PIPEnCTR_6_8_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 962 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 963 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 964 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 965 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 966 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 967 | USB_PIPEnCTR_6_8_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 968 | USB_PIPEnCTR_6_8_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 969 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 970 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 971 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 972 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 973 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 974 | USB_PIPEnCTR_9_SQCLR_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 975 | USB_PIPEnCTR_9_SQCLR); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 976 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 977 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 978 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 979 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 980 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 981 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 982 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 983 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 984 | * Function Name: usb0_host_set_sqset |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 985 | * Description : Sets the sequence bit of the pipe specified by the argument to |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 986 | * : DATA1. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 987 | * Arguments : uint16_t pipe ; Pipe number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 988 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 989 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 990 | void usb0_host_set_sqset (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 991 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 992 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 993 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 994 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 995 | RZA_IO_RegWrite_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 996 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 997 | USB_DCPCTR_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 998 | USB_DCPCTR_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 999 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1000 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1001 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1002 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1003 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1004 | USB_PIPEnCTR_1_5_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1005 | USB_PIPEnCTR_1_5_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1006 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1007 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1008 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1009 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1010 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1011 | USB_PIPEnCTR_1_5_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1012 | USB_PIPEnCTR_1_5_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1013 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1014 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1015 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1016 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1017 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1018 | USB_PIPEnCTR_1_5_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1019 | USB_PIPEnCTR_1_5_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1020 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1021 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1022 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1023 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1024 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1025 | USB_PIPEnCTR_1_5_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1026 | USB_PIPEnCTR_1_5_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1027 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1028 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1029 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1030 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1031 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1032 | USB_PIPEnCTR_1_5_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1033 | USB_PIPEnCTR_1_5_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1034 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1035 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1036 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1037 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1038 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1039 | USB_PIPEnCTR_6_8_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1040 | USB_PIPEnCTR_6_8_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1041 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1042 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1043 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1044 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1045 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1046 | USB_PIPEnCTR_6_8_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1047 | USB_PIPEnCTR_6_8_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1048 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1049 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1050 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1051 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1052 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1053 | USB_PIPEnCTR_6_8_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1054 | USB_PIPEnCTR_6_8_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1055 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1056 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1057 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1058 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1059 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1060 | USB_PIPEnCTR_9_SQSET_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1061 | USB_PIPEnCTR_9_SQSET); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1062 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1063 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1064 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1065 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1066 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1067 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1068 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1069 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1070 | * Function Name: usb0_host_get_sqmon |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1071 | * Description : Toggle bit of specified pipe is obtained |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1072 | * Arguments : uint16_t pipe ; Pipe number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1073 | * Return Value : sqmon |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1074 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1075 | uint16_t usb0_host_get_sqmon (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1076 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1077 | uint16_t sqmon; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1078 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1079 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1080 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1081 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1082 | sqmon = RZA_IO_RegRead_16(&USB200.DCPCTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1083 | USB_DCPCTR_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1084 | USB_DCPCTR_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1085 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1086 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1087 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1088 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1089 | USB_PIPEnCTR_1_5_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1090 | USB_PIPEnCTR_1_5_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1091 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1092 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1093 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1094 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1095 | USB_PIPEnCTR_1_5_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1096 | USB_PIPEnCTR_1_5_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1097 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1098 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1099 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1100 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1101 | USB_PIPEnCTR_1_5_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1102 | USB_PIPEnCTR_1_5_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1103 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1104 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1105 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1106 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1107 | USB_PIPEnCTR_1_5_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1108 | USB_PIPEnCTR_1_5_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1109 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1110 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1111 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1112 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1113 | USB_PIPEnCTR_1_5_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1114 | USB_PIPEnCTR_1_5_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1115 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1116 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1117 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1118 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1119 | USB_PIPEnCTR_6_8_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1120 | USB_PIPEnCTR_6_8_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1121 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1122 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1123 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1124 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1125 | USB_PIPEnCTR_6_8_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1126 | USB_PIPEnCTR_6_8_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1127 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1128 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1129 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1130 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1131 | USB_PIPEnCTR_6_8_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1132 | USB_PIPEnCTR_6_8_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1133 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1134 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1135 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1136 | sqmon = RZA_IO_RegRead_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1137 | USB_PIPEnCTR_9_SQMON_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1138 | USB_PIPEnCTR_9_SQMON); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1139 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1140 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1141 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1142 | sqmon = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1143 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1144 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1145 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1146 | return sqmon; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1147 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1148 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1149 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1150 | * Function Name: usb0_host_aclrm |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1151 | * Description : The buffer of specified pipe is initialized |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1152 | * Arguments : uint16_t pipe : Pipe |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1153 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1154 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1155 | void usb0_host_aclrm (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1156 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1157 | usb0_host_set_aclrm(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1158 | usb0_host_clr_aclrm(pipe); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1159 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1160 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1161 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1162 | * Function Name: usb0_host_set_aclrm |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1163 | * Description : The auto buffer clear mode of specified pipe is enabled |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1164 | * Arguments : uint16_t pipe : Pipe |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1165 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1166 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1167 | void usb0_host_set_aclrm (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1168 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1169 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1170 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1171 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1172 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1173 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1174 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1175 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1176 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1177 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1178 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1179 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1180 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1181 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1182 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1183 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1184 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1185 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1186 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1187 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1188 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1189 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1190 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1191 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1192 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1193 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1194 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1195 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1196 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1197 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1198 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1199 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1200 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1201 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1202 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1203 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1204 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1205 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1206 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1207 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1208 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1209 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1210 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1211 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1212 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1213 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1214 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1215 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1216 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1217 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1218 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1219 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1220 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1221 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1222 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1223 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1224 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1225 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1226 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1227 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1228 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1229 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1230 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1231 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1232 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1233 | USB_PIPEnCTR_9_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1234 | USB_PIPEnCTR_9_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1235 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1236 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1237 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1238 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1239 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1240 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1241 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1242 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1243 | * Function Name: usb0_host_clr_aclrm |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1244 | * Description : The auto buffer clear mode of specified pipe is enabled |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1245 | * Arguments : uint16_t pipe : Pipe |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1246 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1247 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1248 | void usb0_host_clr_aclrm (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1249 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1250 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1251 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1252 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1253 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1254 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1255 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1256 | RZA_IO_RegWrite_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1257 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1258 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1259 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1260 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1261 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1262 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1263 | RZA_IO_RegWrite_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1264 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1265 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1266 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1267 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1268 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1269 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1270 | RZA_IO_RegWrite_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1271 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1272 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1273 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1274 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1275 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1276 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1277 | RZA_IO_RegWrite_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1278 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1279 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1280 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1281 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1282 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1283 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1284 | RZA_IO_RegWrite_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1285 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1286 | USB_PIPEnCTR_1_5_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1287 | USB_PIPEnCTR_1_5_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1288 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1289 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1290 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1291 | RZA_IO_RegWrite_16(&USB200.PIPE6CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1292 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1293 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1294 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1295 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1296 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1297 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1298 | RZA_IO_RegWrite_16(&USB200.PIPE7CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1299 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1300 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1301 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1302 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1303 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1304 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1305 | RZA_IO_RegWrite_16(&USB200.PIPE8CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1306 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1307 | USB_PIPEnCTR_6_8_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1308 | USB_PIPEnCTR_6_8_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1309 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1310 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1311 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1312 | RZA_IO_RegWrite_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1313 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1314 | USB_PIPEnCTR_9_ACLRM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1315 | USB_PIPEnCTR_9_ACLRM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1316 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1317 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1318 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1319 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1320 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1321 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1322 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1323 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1324 | * Function Name: usb0_host_get_inbuf |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1325 | * Description : Returns INBUFM of the pipe specified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1326 | * Arguments : uint16_t pipe ; Pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1327 | * Return Value : inbuf |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1328 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1329 | uint16_t usb0_host_get_inbuf (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1330 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1331 | uint16_t inbuf; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1332 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1333 | switch (pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1334 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1335 | case USB_HOST_PIPE0: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1336 | inbuf = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1337 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1338 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1339 | case USB_HOST_PIPE1: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1340 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE1CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1341 | USB_PIPEnCTR_1_5_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1342 | USB_PIPEnCTR_1_5_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1343 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1344 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1345 | case USB_HOST_PIPE2: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1346 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE2CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1347 | USB_PIPEnCTR_1_5_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1348 | USB_PIPEnCTR_1_5_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1349 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1350 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1351 | case USB_HOST_PIPE3: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1352 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE3CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1353 | USB_PIPEnCTR_1_5_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1354 | USB_PIPEnCTR_1_5_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1355 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1356 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1357 | case USB_HOST_PIPE4: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1358 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE4CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1359 | USB_PIPEnCTR_1_5_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1360 | USB_PIPEnCTR_1_5_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1361 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1362 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1363 | case USB_HOST_PIPE5: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1364 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE5CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1365 | USB_PIPEnCTR_1_5_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1366 | USB_PIPEnCTR_1_5_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1367 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1368 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1369 | case USB_HOST_PIPE6: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1370 | inbuf = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1371 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1372 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1373 | case USB_HOST_PIPE7: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1374 | inbuf = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1375 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1376 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1377 | case USB_HOST_PIPE8: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1378 | inbuf = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1379 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1380 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1381 | case USB_HOST_PIPE9: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1382 | inbuf = RZA_IO_RegRead_16(&USB200.PIPE9CTR, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1383 | USB_PIPEnCTR_9_INBUFM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1384 | USB_PIPEnCTR_9_INBUFM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1385 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1386 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1387 | default: |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1388 | inbuf = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1389 | break; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1390 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1391 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1392 | return inbuf; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1393 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1394 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1395 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1396 | * Function Name: usb0_host_setting_interrupt |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1397 | * Description : Sets the USB module interrupt level. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1398 | * Arguments : uint8_t level ; interrupt level |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1399 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1400 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1401 | void usb0_host_setting_interrupt (uint8_t level) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1402 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1403 | #if(1) /* ohci_wrapp */ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1404 | IRQn_Type d0fifo_dmaintid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1405 | IRQn_Type d1fifo_dmaintid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1406 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1407 | InterruptHandlerRegister(USBI0_IRQn, usb0_host_interrupt); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1408 | GIC_SetPriority(USBI0_IRQn, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1409 | GIC_EnableIRQ(USBI0_IRQn); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1410 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1411 | d0fifo_dmaintid = (IRQn_Type)Userdef_USB_usb0_host_d0fifo_dmaintid(); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1412 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1413 | if (d0fifo_dmaintid != 0xFFFF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1414 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1415 | InterruptHandlerRegister(d0fifo_dmaintid, usb0_host_dma_interrupt_d0fifo); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1416 | GIC_SetPriority(d0fifo_dmaintid, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1417 | GIC_EnableIRQ(d0fifo_dmaintid); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1418 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1419 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1420 | d1fifo_dmaintid = (IRQn_Type)Userdef_USB_usb0_host_d1fifo_dmaintid(); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1421 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1422 | if (d1fifo_dmaintid != 0xFFFF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1423 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1424 | InterruptHandlerRegister(d1fifo_dmaintid, usb0_host_dma_interrupt_d1fifo); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1425 | GIC_SetPriority(d1fifo_dmaintid, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1426 | GIC_EnableIRQ(d1fifo_dmaintid); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1427 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1428 | #else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1429 | uint16_t d0fifo_dmaintid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1430 | uint16_t d1fifo_dmaintid; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1431 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1432 | R_INTC_RegistIntFunc(INTC_ID_USBI0, usb0_host_interrupt); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1433 | R_INTC_SetPriority(INTC_ID_USBI0, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1434 | R_INTC_Enable(INTC_ID_USBI0); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1435 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1436 | d0fifo_dmaintid = Userdef_USB_usb0_host_d0fifo_dmaintid(); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1437 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1438 | if (d0fifo_dmaintid != 0xFFFF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1439 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1440 | R_INTC_RegistIntFunc(d0fifo_dmaintid, usb0_host_dma_interrupt_d0fifo); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1441 | R_INTC_SetPriority(d0fifo_dmaintid, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1442 | R_INTC_Enable(d0fifo_dmaintid); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1443 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1444 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1445 | d1fifo_dmaintid = Userdef_USB_usb0_host_d1fifo_dmaintid(); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1446 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1447 | if (d1fifo_dmaintid != 0xFFFF) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1448 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1449 | R_INTC_RegistIntFunc(d1fifo_dmaintid, usb0_host_dma_interrupt_d1fifo); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1450 | R_INTC_SetPriority(d1fifo_dmaintid, level); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1451 | R_INTC_Enable(d1fifo_dmaintid); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1452 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1453 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1454 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1455 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1456 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1457 | * Function Name: usb0_host_reset_module |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1458 | * Description : Initializes the USB module. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1459 | * : Enables providing clock to the USB module. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1460 | * : Sets USB bus wait register. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1461 | * Arguments : uint16_t clockmode ; 48MHz ; USBHCLOCK_X1_48MHZ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1462 | * : ; 12MHz ; USBHCLOCK_EXTAL_12MHZ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1463 | * Return Value : none |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1464 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1465 | void usb0_host_reset_module (uint16_t clockmode) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1466 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1467 | if (RZA_IO_RegRead_16(&USB200.SYSCFG0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1468 | USB_SYSCFG_UPLLE_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1469 | USB_SYSCFG_UPLLE) == 1) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1470 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1471 | if ((USB200.SYSCFG0 & USB_HOST_BITUCKSEL) != clockmode) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1472 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1473 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1474 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1475 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1476 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1477 | USB200.SYSCFG0 = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1478 | USB200.SYSCFG0 = (USB_HOST_BITUPLLE | clockmode); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1479 | Userdef_USB_usb0_host_delay_xms(1); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1480 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1481 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1482 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1483 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1484 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1485 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1486 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1487 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1488 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1489 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1490 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1491 | Userdef_USB_usb0_host_delay_xms(1); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1492 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1493 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1494 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1495 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1496 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1497 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1498 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1499 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1500 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1501 | 0, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1502 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1503 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1504 | USB200.SYSCFG0 = 0; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1505 | USB200.SYSCFG0 = (USB_HOST_BITUPLLE | clockmode); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1506 | Userdef_USB_usb0_host_delay_xms(1); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1507 | RZA_IO_RegWrite_16(&USB200.SUSPMODE, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1508 | 1, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1509 | USB_SUSPMODE_SUSPM_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1510 | USB_SUSPMODE_SUSPM); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1511 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1512 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1513 | USB200.BUSWAIT = (uint16_t)(USB_HOST_BUSWAIT_05 & USB_HOST_BITBWAIT); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1514 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1515 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1516 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1517 | * Function Name: usb0_host_get_buf_size |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1518 | * Description : Obtains pipe buffer size specified by the argument and |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1519 | * : maximum packet size of the USB device in use. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1520 | * : When USB_HOST_PIPE0 is specified by the argument, obtains the maximum |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1521 | * : packet size of the USB device using the corresponding pipe. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1522 | * : For the case that USB_HOST_PIPE0 is not assigned by the argument, when the |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1523 | * : corresponding pipe is in continuous transfer mode, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1524 | * : obtains the buffer size allocated in the corresponcing pipe, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1525 | * : when incontinuous transfer, obtains maximum packet size. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1526 | * Arguments : uint16_t ; pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1527 | * Return Value : Maximum packet size or buffer size |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1528 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1529 | uint16_t usb0_host_get_buf_size (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1530 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1531 | uint16_t size; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1532 | uint16_t bufsize; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1533 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1534 | if (pipe == USB_HOST_PIPE0) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1535 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1536 | size = RZA_IO_RegRead_16(&USB200.DCPMAXP, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1537 | USB_DCPMAXP_MXPS_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1538 | USB_DCPMAXP_MXPS); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1539 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1540 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1541 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1542 | if (RZA_IO_RegRead_16(&g_usb0_host_pipecfg[pipe], USB_PIPECFG_CNTMD_SHIFT, USB_PIPECFG_CNTMD) == 1) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1543 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1544 | bufsize = RZA_IO_RegRead_16(&g_usb0_host_pipebuf[pipe], USB_PIPEBUF_BUFSIZE_SHIFT, USB_PIPEBUF_BUFSIZE); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1545 | size = (uint16_t)((bufsize + 1) * USB_HOST_PIPExBUF); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1546 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1547 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1548 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1549 | size = RZA_IO_RegRead_16(&g_usb0_host_pipemaxp[pipe], USB_PIPEMAXP_MXPS_SHIFT, USB_PIPEMAXP_MXPS); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1550 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1551 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1552 | return size; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1553 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1554 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1555 | /******************************************************************************* |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1556 | * Function Name: usb0_host_get_mxps |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1557 | * Description : Obtains maximum packet size of the USB device using the pipe |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1558 | * : specified by the argument. |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1559 | * Arguments : uint16_t ; Pipe Number |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1560 | * Return Value : Max Packet Size |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1561 | *******************************************************************************/ |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1562 | uint16_t usb0_host_get_mxps (uint16_t pipe) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1563 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1564 | uint16_t size; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1565 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1566 | if (pipe == USB_HOST_PIPE0) |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1567 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1568 | size = RZA_IO_RegRead_16(&USB200.DCPMAXP, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1569 | USB_DCPMAXP_MXPS_SHIFT, |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1570 | USB_DCPMAXP_MXPS); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1571 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1572 | else |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1573 | { |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1574 | size = RZA_IO_RegRead_16(&g_usb0_host_pipemaxp[pipe], USB_PIPEMAXP_MXPS_SHIFT, USB_PIPEMAXP_MXPS); |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1575 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1576 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1577 | return size; |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1578 | } |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1579 | |
frq08711@LMECWL0871.LME.ST.COM | 1:ab240722d7ef | 1580 | /* End of File */ |