Pierre Bizouard / USBDEVICE

Dependents:   DISCO-F429ZI_LCDTS_demo_richard

Fork of USBDEVICE by ST

Committer:
frq08711@LMECWL0871.LME.ST.COM
Date:
Thu Dec 15 17:40:59 2016 +0100
Revision:
1:2a3ae13b45ef
copy of git hub directory unsupported/USBDevice

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 1 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 2 * DISCLAIMER
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 3 * This software is supplied by Renesas Electronics Corporation and is only
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 4 * intended for use with Renesas products. No other uses are authorized. This
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 5 * software is owned by Renesas Electronics Corporation and is protected under
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 6 * all applicable laws, including copyright laws.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 16 * Renesas reserves the right, without notice, to make changes to this software
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 17 * and to discontinue the availability of this software. By using this software,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 18 * you agree to the additional terms and conditions found by accessing the
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 19 * following link:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 20 * http://www.renesas.com/disclaimer
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 22 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 23 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 24 * File Name : usb0_function_api.c
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 25 * $Rev: 1116 $
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 26 * $Date:: 2014-07-09 16:29:19 +0900#$
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 27 * Device(s) : RZ/A1H
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 28 * Tool-Chain :
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 29 * OS : None
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 30 * H/W Platform :
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 31 * Description : RZ/A1H R7S72100 USB Sample Program
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 32 * Operation :
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 33 * Limitations :
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 34 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 35
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 36
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 37 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 38 Includes <System Includes> , "Project Includes"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 39 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 40 #include "usb0_function.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 41 #include "dev_drv.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 42
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 43
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 44 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 45 Typedef definitions
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 46 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 47
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 48
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 49 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 50 Macro definitions
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 51 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 52
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 53
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 54 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 55 Imported global variables and functions (from other files)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 56 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 57
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 58
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 59 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 60 Exported global variables and functions (to be accessed by other files)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 61 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 62
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 63
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 64 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 65 Private global variables and functions
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 66 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 67
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 68
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 69 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 70 * Function Name: usb0_api_function_init
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 71 * Description : Initializes the USB module in the USB function mode.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 72 * Arguments : uint8_t int_level ; interruput level
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 73 * : uint16_t mode : Speed modes
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 74 * : : USB_FUCNTION_HIGH_SPEED: High-speed device
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 75 * : : USB_FUCNTION_FULL_SPEED: Full-speed device
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 76 * : uint16_t clockmode ; 48MHz ; USBFCLOCK_X1_48MHZ
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 77 * : ; 12MHz ; USBFCLOCK_EXTAL_12MHZ
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 78 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 79 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 80 #if 0
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 81 void usb0_api_function_init (uint8_t int_level, uint16_t mode, uint16_t clockmode)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 82 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 83 volatile uint8_t dummy_buf;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 84
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 85 CPG.STBCR7 &= 0xfd; /* The clock of USB0 modules is permitted */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 86 dummy_buf = CPG.STBCR7; /* (Dummy read) */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 87
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 88 usb0_function_setting_interrupt(int_level);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 89
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 90 usb0_function_reset_module(clockmode); /* reset USB module with setting tranciever */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 91 /* and HSE=1 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 92
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 93 usb0_function_init_status(); /* clear variables */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 94
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 95 usb0_function_InitModule(mode); /* select USB Function and Interrupt Enable */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 96 /* Detect USB Device to attach or detach */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 97 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 98 #endif
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 99
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 100 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 101 * Function Name: usb0_api_function_IsConfigured
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 102 * Description : Checks if the USB device is configured to return the result as
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 103 * : the return value.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 104 * Arguments : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 105 * Return Value : DEVDRV_USBF_YES : Configured & Configured Suspend
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 106 * : DEVDRV_USBF_NO : not Configured
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 107 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 108 uint16_t usb0_api_function_IsConfigured (void)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 109 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 110 uint16_t dvst;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 111
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 112 dvst = usb0_function_GetDeviceState();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 113
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 114 if ((dvst == USB_FUNCTION_DVST_CONFIGURED) ||
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 115 (dvst == USB_FUNCTION_DVST_CONFIGURED_SUSPEND))
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 116 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 117 return DEVDRV_USBF_YES;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 118 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 119
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 120 return DEVDRV_USBF_NO;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 121 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 122
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 123 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 124 * Function Name: usb0_function_GetDeviceState
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 125 * Description : Returns the state of USB device.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 126 * Arguments : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 127 * Return Value : Device States
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 128 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 129 uint16_t usb0_function_GetDeviceState (void)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 130 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 131 uint16_t dvsq;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 132 uint16_t dvst;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 133
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 134 dvsq = USB200.INTSTS0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 135 switch(dvsq & USB_FUNCTION_BITDVSQ)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 136 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 137 case USB_FUNCTION_DS_POWR: /* Power state *//* power-on */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 138 dvst = USB_FUNCTION_DVST_POWERED;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 139 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 140
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 141 case USB_FUNCTION_DS_DFLT: /* Default state *//* bus-reset */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 142 dvst = USB_FUNCTION_DVST_DEFAULT;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 143 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 144
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 145 case USB_FUNCTION_DS_ADDS: /* Address state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 146 dvst = USB_FUNCTION_DVST_ADDRESS;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 147 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 148
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 149 case USB_FUNCTION_DS_CNFG: /* Configured state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 150 dvst = USB_FUNCTION_DVST_CONFIGURED;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 151 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 152
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 153 case USB_FUNCTION_DS_SPD_CNFG: /* Configured Suspend state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 154 dvst = USB_FUNCTION_DVST_CONFIGURED_SUSPEND;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 155 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 156
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 157 case USB_FUNCTION_DS_SPD_POWR: /* Power Suspend state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 158 case USB_FUNCTION_DS_SPD_DFLT: /* Default Suspend state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 159 case USB_FUNCTION_DS_SPD_ADDR: /* Address Suspend state */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 160 dvst = USB_FUNCTION_DVST_SUSPEND;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 161 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 162
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 163 default: /* error */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 164 dvst = USB_FUNCTION_DVST_SUSPEND;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 165 break;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 166 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 167
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 168 return dvst;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 169 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 170
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 171 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 172 * Function Name: usb0_api_function_start_receive_transfer
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 173 * Description : Starts USB data reception using the pipe specified in the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 174 * : The FIFO for using is set in the pipe definition table.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 175 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 176 * : uint32_t size ; Data Size
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 177 * : uint8_t *data ; Data data Address
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 178 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 179 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 180 void usb0_api_function_start_receive_transfer (uint16_t pipe, uint32_t size, uint8_t * data)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 181 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 182 usb0_function_start_receive_transfer(pipe, size, data);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 183 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 184
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 185 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 186 * Function Name: usb0_api_function_start_send_transfer
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 187 * Description : Starts the USB data communication using pipe specified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 188 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 189 * : uint32_t size ; Data Size
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 190 * : uint8_t *data ; Data data Address
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 191 * Return Value : DEVDRV_USBF_WRITEEND ; Write end
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 192 * : DEVDRV_USBF_WRITESHRT ; short data
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 193 * : DEVDRV_USBF_WRITING ; Continue of data write
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 194 * : DEVDRV_USBF_WRITEDMA ; Write DMA
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 195 * : DEVDRV_USBF_FIFOERROR ; FIFO status
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 196 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 197 uint16_t usb0_api_function_start_send_transfer (uint16_t pipe, uint32_t size, uint8_t * data)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 198 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 199 uint16_t status;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 200
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 201 status = usb0_function_start_send_transfer(pipe, size, data);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 202
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 203 return status;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 204 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 205
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 206 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 207 * Function Name: usb0_api_function_check_pipe_status
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 208 * Description : Starts USB data reception using the pipe specified in the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 209 * : The FIFO for using is set in the pipe definition table.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 210 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 211 * : uint32_t *size ; Data Size
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 212 * Return Value : Pipe Status
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 213 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 214 uint16_t usb0_api_function_check_pipe_status (uint16_t pipe, uint32_t * size)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 215 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 216 if (g_usb0_function_pipe_status[pipe] == DEVDRV_USBF_PIPE_DONE)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 217 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 218 *size = g_usb0_function_PipeDataSize[pipe];
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 219 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 220
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 221 return DEVDRV_USBF_PIPE_DONE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 222 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 223 else if (g_usb0_function_pipe_status[pipe] == DEVDRV_USBF_PIPE_NORES)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 224 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 225 *size = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 226 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 227
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 228 return DEVDRV_USBF_PIPE_NORES;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 229 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 230 else if (g_usb0_function_pipe_status[pipe] == DEVDRV_USBF_PIPE_STALL)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 231 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 232 *size = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 233 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 234
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 235 return DEVDRV_USBF_PIPE_STALL;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 236 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 237 else if (g_usb0_function_pipe_status[pipe] == DEVDRV_USBF_FIFOERROR)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 238 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 239 *size = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 240 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 241
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 242 return DEVDRV_USBF_FIFOERROR;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 243 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 244 else
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 245 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 246 /* Do Nothing */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 247 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 248
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 249 return g_usb0_function_pipe_status[pipe];
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 250 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 251
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 252 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 253 * Function Name: usb0_api_function_clear_pipe_status
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 254 * Description : Starts USB data reception using the pipe specified in the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 255 * : The FIFO for using is set in the pipe definition table.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 256 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 257 * Return Value : Pipe Status
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 258 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 259 void usb0_api_function_clear_pipe_status (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 260 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 261 g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 262 g_usb0_function_PipeDataSize[pipe] = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 263 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 264
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 265 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 266 * Function Name: usb0_api_function_set_pid_buf
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 267 * Description : Enables communicaqtion in the pipe specified by the argument
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 268 * : (BUF).
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 269 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 270 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 271 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 272 void usb0_api_function_set_pid_buf (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 273 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 274 usb0_function_set_pid_buf(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 275 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 276
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 277 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 278 * Function Name: usb0_api_function_set_pid_nak
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 279 * Description : Disables communication (NAK) in the pipe specified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 280 * : When the pipe status was enabling communication (BUF) before
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 281 * : executing before executing this function, waits in the software
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 282 * : until the pipe becomes ready after setting disabled.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 283 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 284 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 285 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 286 void usb0_api_function_set_pid_nak (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 287 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 288 usb0_function_set_pid_nak(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 289 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 290
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 291 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 292 * Function Name: usb0_api_function_set_pid_stall
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 293 * Description : Disables communication (STALL) in the pipe specified by the
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 294 * : argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 295 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 296 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 297 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 298 void usb0_api_function_set_pid_stall (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 299 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 300 usb0_function_set_pid_stall(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 301 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 302
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 303 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 304 * Function Name: usb0_api_function_clear_pid_stall
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 305 * Description : Disables communication (NAK) in the pipe specified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 306 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 307 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 308 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 309 void usb0_api_function_clear_pid_stall (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 310 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 311 usb0_function_clear_pid_stall(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 312 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 313
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 314 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 315 * Function Name: usb0_api_function_get_pid
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 316 * Description : Returns the pipe state specified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 317 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 318 * Return Value : PID
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 319 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 320 uint16_t usb0_api_function_get_pid (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 321 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 322 uint16_t pid;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 323
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 324 pid = usb0_function_get_pid(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 325
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 326 return pid;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 327 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 328
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 329 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 330 * Function Name: usb0_api_function_check_stall
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 331 * Description :
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 332 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 333 * Return Value : PID
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 334 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 335 int32_t usb0_api_function_check_stall (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 336 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 337 uint16_t pid;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 338
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 339 pid = usb0_function_get_pid(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 340
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 341 if ((pid & DEVDRV_USBF_PID_STALL) == DEVDRV_USBF_PID_STALL)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 342 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 343 return DEVDRV_USBF_STALL;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 344 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 345
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 346 return DEVDRV_SUCCESS;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 347 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 348
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 349 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 350 * Function Name: usb0_api_function_set_sqclr
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 351 * Description : Sets the sequence bit of the pipe specified by the argument to
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 352 * : DATA0.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 353 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 354 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 355 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 356 void usb0_api_function_set_sqclr (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 357 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 358 usb0_function_set_sqclr(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 359 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 360
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 361 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 362 * Function Name: usb0_api_function_set_sqset
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 363 * Description : Sets the sequence bit of the pipe specified by the argument to
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 364 * : DATA1.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 365 * Arguments : uint16_t pipe ; Pipe number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 366 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 367 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 368 void usb0_api_function_set_sqset (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 369 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 370 usb0_function_set_sqset(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 371 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 372
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 373 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 374 * Function Name: usb0_api_function_set_csclr
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 375 * Description : CSPLIT status clear setting of sprit transaction in specified
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 376 * : pipe is performed.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 377 * : When SQSET bit or SQCLR bit, and SQSET bit or SQCLR bit
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 378 * : in DCPCTR register are continuously changed (when the sequence
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 379 * : toggle bit of data PID is continuously changed over two or more pipes),
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 380 * : the access cycle with 120 ns and more than 5 cycle bus clock is necessary.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 381 * : Do not set both SQCLR bit and SQSET bit to 1 at the same time.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 382 * : In addition, both bits should be operated after PID is set to NAK.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 383 * : However, when it is set to the isochronous transfer as the transfer type
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 384 * : (TYPE=11), writing in SQSET bit is disabled.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 385 * Arguments : uint16_t pipe ; Pipe number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 386 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 387 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 388 void usb0_api_function_set_csclr (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 389 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 390 usb0_function_set_csclr(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 391 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 392
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 393 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 394 * Function Name: usb0_api_function_set_curpipe
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 395 * Description : Allocates FIF0 specifed by the argument in the pipe assigned
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 396 * : by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 397 * Arguments : uint16_t pipe ; Pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 398 * : uint16_t fifosel ; Select FIFO
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 399 * : uint16_t isel ; FIFO Access Direction
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 400 * : uint16_t mbw ; FIFO Port Access Bit Width
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 401 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 402 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 403 void usb0_api_function_set_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 404 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 405 usb0_function_set_curpipe(pipe, fifosel, isel, mbw);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 406 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 407
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 408 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 409 * Function Name: usb0_api_function_clear_brdy_sts
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 410 * Description : Clear BRDY interrupt status in the pipe spceified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 411 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 412 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 413 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 414 void usb0_api_function_clear_brdy_sts (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 415 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 416 usb0_function_clear_brdy_sts(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 417 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 418
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 419 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 420 * Function Name: usb0_api_function_clear_bemp_sts
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 421 * Description : Clear BEMP interrupt status in the pipe spceified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 422 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 423 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 424 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 425 void usb0_api_function_clear_bemp_sts (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 426 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 427 usb0_function_clear_bemp_sts(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 428 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 429
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 430 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 431 * Function Name: usb0_api_function_clear_nrdy_sts
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 432 * Description : Clear NRDY interrupt status in the pipe spceified by the argument.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 433 * Arguments : uint16_t pipe ; pipe Number
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 434 * Return Value : none
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 435 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 436 void usb0_api_function_clear_nrdy_sts (uint16_t pipe)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 437 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 438 usb0_function_clear_nrdy_sts(pipe);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 439 }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 440
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 441 /* End of File */