USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Committer:
Kojto
Date:
Thu Jul 27 12:14:04 2017 +0100
Revision:
71:53949e6131f6
Update libraries

Fixes the previous commmit, as some devices were not copied. USBDevice contains
now targets directory with all targets implementations

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 71:53949e6131f6 1 /*******************************************************************************
Kojto 71:53949e6131f6 2 * DISCLAIMER
Kojto 71:53949e6131f6 3 * This software is supplied by Renesas Electronics Corporation and is only
Kojto 71:53949e6131f6 4 * intended for use with Renesas products. No other uses are authorized. This
Kojto 71:53949e6131f6 5 * software is owned by Renesas Electronics Corporation and is protected under
Kojto 71:53949e6131f6 6 * all applicable laws, including copyright laws.
Kojto 71:53949e6131f6 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
Kojto 71:53949e6131f6 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
Kojto 71:53949e6131f6 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
Kojto 71:53949e6131f6 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
Kojto 71:53949e6131f6 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
Kojto 71:53949e6131f6 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
Kojto 71:53949e6131f6 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
Kojto 71:53949e6131f6 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
Kojto 71:53949e6131f6 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Kojto 71:53949e6131f6 16 * Renesas reserves the right, without notice, to make changes to this software
Kojto 71:53949e6131f6 17 * and to discontinue the availability of this software. By using this software,
Kojto 71:53949e6131f6 18 * you agree to the additional terms and conditions found by accessing the
Kojto 71:53949e6131f6 19 * following link:
Kojto 71:53949e6131f6 20 * http://www.renesas.com/disclaimer
Kojto 71:53949e6131f6 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
Kojto 71:53949e6131f6 22 *******************************************************************************/
Kojto 71:53949e6131f6 23 /*******************************************************************************
Kojto 71:53949e6131f6 24 * File Name : devdrv_usb_function_api.h
Kojto 71:53949e6131f6 25 * $Rev: 1116 $
Kojto 71:53949e6131f6 26 * $Date:: 2014-07-09 16:29:19 +0900#$
Kojto 71:53949e6131f6 27 * Description : RZ/A1H R7S72100 USB Sample Program
Kojto 71:53949e6131f6 28 *******************************************************************************/
Kojto 71:53949e6131f6 29 #ifndef USB_FUNCTION_API_H
Kojto 71:53949e6131f6 30 #define USB_FUNCTION_API_H
Kojto 71:53949e6131f6 31
Kojto 71:53949e6131f6 32
Kojto 71:53949e6131f6 33 /*******************************************************************************
Kojto 71:53949e6131f6 34 Includes <System Includes> , "Project Includes"
Kojto 71:53949e6131f6 35 *******************************************************************************/
Kojto 71:53949e6131f6 36 #include <MBRZA1H.h>
Kojto 71:53949e6131f6 37 #include "r_typedefs.h"
Kojto 71:53949e6131f6 38 #include "usb0_function_api.h"
Kojto 71:53949e6131f6 39 #include "usb1_function_api.h"
Kojto 71:53949e6131f6 40
Kojto 71:53949e6131f6 41
Kojto 71:53949e6131f6 42 #ifdef __cplusplus
Kojto 71:53949e6131f6 43 extern "C" {
Kojto 71:53949e6131f6 44 #endif
Kojto 71:53949e6131f6 45
Kojto 71:53949e6131f6 46 /*******************************************************************************
Kojto 71:53949e6131f6 47 Typedef definitions
Kojto 71:53949e6131f6 48 *******************************************************************************/
Kojto 71:53949e6131f6 49 typedef struct
Kojto 71:53949e6131f6 50 {
Kojto 71:53949e6131f6 51 uint32_t fifo;
Kojto 71:53949e6131f6 52 uint32_t buffer;
Kojto 71:53949e6131f6 53 uint32_t bytes;
Kojto 71:53949e6131f6 54 uint32_t dir;
Kojto 71:53949e6131f6 55 uint32_t size;
Kojto 71:53949e6131f6 56 } USB_FUNCTION_DMA_t;
Kojto 71:53949e6131f6 57
Kojto 71:53949e6131f6 58
Kojto 71:53949e6131f6 59 /*******************************************************************************
Kojto 71:53949e6131f6 60 Macro definitions
Kojto 71:53949e6131f6 61 *******************************************************************************/
Kojto 71:53949e6131f6 62 #define USBFCLOCK_X1_48MHZ (0x0000u) /* USB_X1_48MHz */
Kojto 71:53949e6131f6 63 #define USBFCLOCK_EXTAL_12MHZ (0x0004u) /* EXTAL_12MHz */
Kojto 71:53949e6131f6 64
Kojto 71:53949e6131f6 65 #define DEVDRV_USBF_ON (1)
Kojto 71:53949e6131f6 66 #define DEVDRV_USBF_OFF (0)
Kojto 71:53949e6131f6 67 #define DEVDRV_USBF_YES (1)
Kojto 71:53949e6131f6 68 #define DEVDRV_USBF_NO (0)
Kojto 71:53949e6131f6 69
Kojto 71:53949e6131f6 70 #define DEVDRV_USBF_STALL (-2)
Kojto 71:53949e6131f6 71
Kojto 71:53949e6131f6 72 #define DEVDRV_USBF_WRITEEND (0)
Kojto 71:53949e6131f6 73 #define DEVDRV_USBF_WRITESHRT (1)
Kojto 71:53949e6131f6 74 #define DEVDRV_USBF_WRITING (2)
Kojto 71:53949e6131f6 75 #define DEVDRV_USBF_WRITEDMA (3)
Kojto 71:53949e6131f6 76
Kojto 71:53949e6131f6 77 #define DEVDRV_USBF_FIFOERROR (0xffff)
Kojto 71:53949e6131f6 78
Kojto 71:53949e6131f6 79 #define DEVDRV_USBF_PIPE_IDLE (0x00)
Kojto 71:53949e6131f6 80 #define DEVDRV_USBF_PIPE_WAIT (0x01)
Kojto 71:53949e6131f6 81 #define DEVDRV_USBF_PIPE_DONE (0x02)
Kojto 71:53949e6131f6 82 #define DEVDRV_USBF_PIPE_NORES (0x03)
Kojto 71:53949e6131f6 83 #define DEVDRV_USBF_PIPE_STALL (0x04)
Kojto 71:53949e6131f6 84
Kojto 71:53949e6131f6 85 #define DEVDRV_USBF_PID_NAK (0x0000u)
Kojto 71:53949e6131f6 86 #define DEVDRV_USBF_PID_BUF (0x0001u)
Kojto 71:53949e6131f6 87 #define DEVDRV_USBF_PID_STALL (0x0002u)
Kojto 71:53949e6131f6 88 #define DEVDRV_USBF_PID_STALL2 (0x0003u)
Kojto 71:53949e6131f6 89
Kojto 71:53949e6131f6 90 #define USB_FUNCTION_NON_SPEED (0)
Kojto 71:53949e6131f6 91 #define USB_FUNCTION_LOW_SPEED (1)
Kojto 71:53949e6131f6 92 #define USB_FUNCTION_FULL_SPEED (2)
Kojto 71:53949e6131f6 93 #define USB_FUNCTION_HIGH_SPEED (3)
Kojto 71:53949e6131f6 94
Kojto 71:53949e6131f6 95 #define USB_FUNCTION_READEND (0)
Kojto 71:53949e6131f6 96 #define USB_FUNCTION_READSHRT (1)
Kojto 71:53949e6131f6 97 #define USB_FUNCTION_READING (2)
Kojto 71:53949e6131f6 98 #define USB_FUNCTION_READOVER (3)
Kojto 71:53949e6131f6 99 #define USB_FUNCTION_READZERO (4)
Kojto 71:53949e6131f6 100
Kojto 71:53949e6131f6 101 #define USB_FUNCTION_MAX_PIPE_NO (15u)
Kojto 71:53949e6131f6 102 #define USB_FUNCTION_PIPE0 (0)
Kojto 71:53949e6131f6 103 #define USB_FUNCTION_PIPE1 (1)
Kojto 71:53949e6131f6 104 #define USB_FUNCTION_PIPE2 (2)
Kojto 71:53949e6131f6 105 #define USB_FUNCTION_PIPE3 (3)
Kojto 71:53949e6131f6 106 #define USB_FUNCTION_PIPE4 (4)
Kojto 71:53949e6131f6 107 #define USB_FUNCTION_PIPE5 (5)
Kojto 71:53949e6131f6 108 #define USB_FUNCTION_PIPE6 (6)
Kojto 71:53949e6131f6 109 #define USB_FUNCTION_PIPE7 (7)
Kojto 71:53949e6131f6 110 #define USB_FUNCTION_PIPE8 (8)
Kojto 71:53949e6131f6 111 #define USB_FUNCTION_PIPE9 (9)
Kojto 71:53949e6131f6 112 #define USB_FUNCTION_PIPEA (10)
Kojto 71:53949e6131f6 113 #define USB_FUNCTION_PIPEB (11)
Kojto 71:53949e6131f6 114 #define USB_FUNCTION_PIPEC (12)
Kojto 71:53949e6131f6 115 #define USB_FUNCTION_PIPED (13)
Kojto 71:53949e6131f6 116 #define USB_FUNCTION_PIPEE (14)
Kojto 71:53949e6131f6 117 #define USB_FUNCTION_PIPEF (15)
Kojto 71:53949e6131f6 118
Kojto 71:53949e6131f6 119 #define USB_FUNCTION_ISO (0xc000u)
Kojto 71:53949e6131f6 120 #define USB_FUNCTION_INTERRUPT (0x8000u)
Kojto 71:53949e6131f6 121 #define USB_FUNCTION_BULK (0x4000u)
Kojto 71:53949e6131f6 122
Kojto 71:53949e6131f6 123 #define USB_FUNCTION_NONE (0x0000u)
Kojto 71:53949e6131f6 124 #define USB_FUNCTON_BFREFIELD (0x0400u)
Kojto 71:53949e6131f6 125 #define USB_FUNCTION_BFREON (0x0400u)
Kojto 71:53949e6131f6 126 #define USB_FUNCTION_BFREOFF (0x0000u)
Kojto 71:53949e6131f6 127 #define USB_FUNCTION_DBLBFIELD (0x0200u)
Kojto 71:53949e6131f6 128 #define USB_FUNCTION_DBLBON (0x0200u)
Kojto 71:53949e6131f6 129 #define USB_FUNCTION_DBLBOFF (0x0000u)
Kojto 71:53949e6131f6 130 #define USB_FUNCTION_CNTMDFIELD (0x0100u)
Kojto 71:53949e6131f6 131 #define USB_FUNCTION_CNTMDON (0x0100u)
Kojto 71:53949e6131f6 132 #define USB_FUNCTION_CNTMDOFF (0x0000u)
Kojto 71:53949e6131f6 133 #define USB_FUNCTION_SHTNAKON (0x0080u)
Kojto 71:53949e6131f6 134 #define USB_FUNCTION_SHTNAKOFF (0x0000u)
Kojto 71:53949e6131f6 135 #define USB_FUNCTION_DIRFIELD (0x0010u)
Kojto 71:53949e6131f6 136 #define USB_FUNCTION_DIR_P_OUT (0x0000u)
Kojto 71:53949e6131f6 137 #define USB_FUNCTION_DIR_P_IN (0x0010u)
Kojto 71:53949e6131f6 138 #define USB_FUNCTION_EPNUMFIELD (0x000fu)
Kojto 71:53949e6131f6 139 #define USB_FUNCTION_MAX_EP_NO (15u)
Kojto 71:53949e6131f6 140 #define USB_FUNCTION_EP0 (0u)
Kojto 71:53949e6131f6 141 #define USB_FUNCTION_EP1 (1u)
Kojto 71:53949e6131f6 142 #define USB_FUNCTION_EP2 (2u)
Kojto 71:53949e6131f6 143 #define USB_FUNCTION_EP3 (3u)
Kojto 71:53949e6131f6 144 #define USB_FUNCTION_EP4 (4u)
Kojto 71:53949e6131f6 145 #define USB_FUNCTION_EP5 (5u)
Kojto 71:53949e6131f6 146 #define USB_FUNCTION_EP6 (6u)
Kojto 71:53949e6131f6 147 #define USB_FUNCTION_EP7 (7u)
Kojto 71:53949e6131f6 148 #define USB_FUNCTION_EP8 (8u)
Kojto 71:53949e6131f6 149 #define USB_FUNCTION_EP9 (9u)
Kojto 71:53949e6131f6 150 #define USB_FUNCTION_EP10 (10u)
Kojto 71:53949e6131f6 151 #define USB_FUNCTION_EP11 (11u)
Kojto 71:53949e6131f6 152 #define USB_FUNCTION_EP12 (12u)
Kojto 71:53949e6131f6 153 #define USB_FUNCTION_EP13 (13u)
Kojto 71:53949e6131f6 154 #define USB_FUNCTION_EP14 (14u)
Kojto 71:53949e6131f6 155 #define USB_FUNCTION_EP15 (15u)
Kojto 71:53949e6131f6 156
Kojto 71:53949e6131f6 157 #define USB_FUNCTION_EPTABLE_LENGTH (5u)
Kojto 71:53949e6131f6 158
Kojto 71:53949e6131f6 159 #define USB_FUNCTION_CUSE (0)
Kojto 71:53949e6131f6 160 #define USB_FUNCTION_D0USE (1)
Kojto 71:53949e6131f6 161 #define USB_FUNCTION_D0DMA (2)
Kojto 71:53949e6131f6 162 #define USB_FUNCTION_D1USE (3)
Kojto 71:53949e6131f6 163 #define USB_FUNCTION_D1DMA (4)
Kojto 71:53949e6131f6 164
Kojto 71:53949e6131f6 165 #define USB_FUNCTION_CFIFO_USE (0x0000)
Kojto 71:53949e6131f6 166 #define USB_FUNCTION_D0FIFO_USE (0x1000)
Kojto 71:53949e6131f6 167 #define USB_FUNCTION_D1FIFO_USE (0x2000)
Kojto 71:53949e6131f6 168 #define USB_FUNCTION_D0FIFO_DMA (0x5000)
Kojto 71:53949e6131f6 169 #define USB_FUNCTION_D1FIFO_DMA (0x6000)
Kojto 71:53949e6131f6 170
Kojto 71:53949e6131f6 171 #define USB_FUNCTION_BUF2FIFO (0)
Kojto 71:53949e6131f6 172 #define USB_FUNCTION_FIFO2BUF (1)
Kojto 71:53949e6131f6 173
Kojto 71:53949e6131f6 174 #define USB_FUNCTION_DVST_POWERED (0x0001)
Kojto 71:53949e6131f6 175 #define USB_FUNCTION_DVST_DEFAULT (0x0002)
Kojto 71:53949e6131f6 176 #define USB_FUNCTION_DVST_ADDRESS (0x0003)
Kojto 71:53949e6131f6 177 #define USB_FUNCTION_DVST_CONFIGURED (0x0004)
Kojto 71:53949e6131f6 178 #define USB_FUNCTION_DVST_SUSPEND (0x0005)
Kojto 71:53949e6131f6 179 #define USB_FUNCTION_DVST_CONFIGURED_SUSPEND (0x0006)
Kojto 71:53949e6131f6 180
Kojto 71:53949e6131f6 181 #define USB_FUNCTION_FUNCTION_TEST_SELECT (0xff00u)
Kojto 71:53949e6131f6 182 #define USB_FUNCTION_FUNCTION_TEST_J (0x0100u)
Kojto 71:53949e6131f6 183 #define USB_FUNCTION_FUNCTION_TEST_K (0x0200u)
Kojto 71:53949e6131f6 184 #define USB_FUNCTION_FUNCTION_TEST_SE0_NAK (0x0300u)
Kojto 71:53949e6131f6 185 #define USB_FUNCTION_FUNCTION_TEST_PACKET (0x0400u)
Kojto 71:53949e6131f6 186 #define USB_FUNCTION_FUNCTION_TEST_FORCE_ENABLE (0x0500u)
Kojto 71:53949e6131f6 187 #define USB_FUNCTION_FUNCTION_TEST_STSelectors (0x0600u)
Kojto 71:53949e6131f6 188 #define USB_FUNCTION_FUNCTION_TEST_Reserved (0x4000u)
Kojto 71:53949e6131f6 189 #define USB_FUNCTION_FUNCTION_TEST_VSTModes (0xc000u)
Kojto 71:53949e6131f6 190
Kojto 71:53949e6131f6 191 #define USB_FUNCTION_DT_TYPE (0xff00u)
Kojto 71:53949e6131f6 192 #define USB_FUNCTION_DT_INDEX (0xff)
Kojto 71:53949e6131f6 193 #define USB_FUNCTION_DT_DEVICE (0x01)
Kojto 71:53949e6131f6 194 #define USB_FUNCTION_DT_CONFIGURATION (0x02)
Kojto 71:53949e6131f6 195 #define USB_FUNCTION_DT_STRING (0x03)
Kojto 71:53949e6131f6 196 #define USB_FUNCTION_DT_INTERFACE (0x04)
Kojto 71:53949e6131f6 197 #define USB_FUNCTION_DT_ENDPOINT (0x05)
Kojto 71:53949e6131f6 198 #define USB_FUNCTION_DT_DEVICE_QUALIFIER (0x06)
Kojto 71:53949e6131f6 199 #define USB_FUNCTION_DT_OTHER_SPEED_CONFIGURATION (0x07)
Kojto 71:53949e6131f6 200 #define USB_FUNCTION_DT_INTERFACE_POWER (0x08)
Kojto 71:53949e6131f6 201
Kojto 71:53949e6131f6 202 #define USB_FUNCTION_CF_RESERVED (0x80)
Kojto 71:53949e6131f6 203 #define USB_FUNCTION_CF_SELF (0x40)
Kojto 71:53949e6131f6 204 #define USB_FUNCTION_CF_RWUP (0x20)
Kojto 71:53949e6131f6 205 #define USB_FUNCTION_CF_NORWUP (0x00)
Kojto 71:53949e6131f6 206 #define USB_FUNCTION_EP_ERROR (0xff)
Kojto 71:53949e6131f6 207
Kojto 71:53949e6131f6 208 #define USB_FUNCTION_EP_OUT (0x00)
Kojto 71:53949e6131f6 209 #define USB_FUNCTION_EP_IN (0x80)
Kojto 71:53949e6131f6 210 #define USB_FUNCTION_EP_CNTRL (0x00)
Kojto 71:53949e6131f6 211 #define USB_FUNCTION_EP_ISO (0x01)
Kojto 71:53949e6131f6 212 #define USB_FUNCTION_EP_BULK (0x02)
Kojto 71:53949e6131f6 213 #define USB_FUNCTION_EP_INT (0x03)
Kojto 71:53949e6131f6 214
Kojto 71:53949e6131f6 215 #define USB_FUNCTION_STANDARD_REQUEST (0x0000u)
Kojto 71:53949e6131f6 216 #define USB_FUNCTION_CLASS_REQUEST (0x0020u)
Kojto 71:53949e6131f6 217 #define USB_FUNCTION_VENDOR_REQUEST (0x0040u)
Kojto 71:53949e6131f6 218 #define USB_FUNCTION_DEVICE_REQUEST (0x0000u)
Kojto 71:53949e6131f6 219 #define USB_FUNCTION_INTERFACE_REQUEST (0x0001u)
Kojto 71:53949e6131f6 220 #define USB_FUNCTION_ENDPOINT_REQUEST (0x0002u)
Kojto 71:53949e6131f6 221
Kojto 71:53949e6131f6 222 #define USB_FUNCTION_GETSTATUS_BUSPOWERD (0x0000u)
Kojto 71:53949e6131f6 223 #define USB_FUNCTION_GETSTATUS_SELFPOWERD (0x0001u)
Kojto 71:53949e6131f6 224 #define USB_FUNCTION_GETSTATUS_REMOTEWAKEUP (0x0002u)
Kojto 71:53949e6131f6 225 #define USB_FUNCTION_GETSTATUS_NOTHALT (0x0000u)
Kojto 71:53949e6131f6 226 #define USB_FUNCTION_GETSTATUS_HALT (0x0001u)
Kojto 71:53949e6131f6 227
Kojto 71:53949e6131f6 228 #define USB_FUNCTION_FEATURE_ENDPOINT_HALT (0x0000u)
Kojto 71:53949e6131f6 229 #define USB_FUNCTION_FEATURE_REMOTE_WAKEUP (0x0001u)
Kojto 71:53949e6131f6 230 #define USB_FUNCTION_FEATURE_TEST_MODE (0x0002u)
Kojto 71:53949e6131f6 231
Kojto 71:53949e6131f6 232 #define USB_FUNCTION_bRequest (0xff00u) /* b15-8:bRequest */
Kojto 71:53949e6131f6 233 #define USB_FUNCTION_bmRequestType (0x00ffu) /* b7-0: bmRequestType */
Kojto 71:53949e6131f6 234 #define USB_FUNCTION_bmRequestTypeDir (0x0080u) /* b7 : Data transfer direction */
Kojto 71:53949e6131f6 235 #define USB_FUNCTION_bmRequestTypeType (0x0060u) /* b6-5: Type */
Kojto 71:53949e6131f6 236 #define USB_FUNCTION_bmRequestTypeRecip (0x001fu) /* b4-0: Recipient */
Kojto 71:53949e6131f6 237
Kojto 71:53949e6131f6 238
Kojto 71:53949e6131f6 239 /*******************************************************************************
Kojto 71:53949e6131f6 240 Variable Externs
Kojto 71:53949e6131f6 241 *******************************************************************************/
Kojto 71:53949e6131f6 242
Kojto 71:53949e6131f6 243
Kojto 71:53949e6131f6 244 /*******************************************************************************
Kojto 71:53949e6131f6 245 Functions Prototypes
Kojto 71:53949e6131f6 246 *******************************************************************************/
Kojto 71:53949e6131f6 247 #if 0
Kojto 71:53949e6131f6 248 void R_USB_api_function_init(uint16_t root, uint8_t int_level, uint16_t mode, uint16_t clockmode);
Kojto 71:53949e6131f6 249 uint16_t R_USB_api_function_IsConfigured(uint16_t root);
Kojto 71:53949e6131f6 250 uint16_t R_USB_api_function_CtrlReadStart(uint16_t root, uint32_t size, uint8_t *data);
Kojto 71:53949e6131f6 251 void R_USB_api_function_CtrlWriteStart(uint16_t root, uint32_t size, uint8_t *data);
Kojto 71:53949e6131f6 252 uint16_t R_USB_api_function_start_send_transfer(uint16_t root, uint16_t pipe, uint32_t size, uint8_t *data);
Kojto 71:53949e6131f6 253 uint16_t R_USB_api_function_check_pipe_status(uint16_t root, uint16_t pipe, uint32_t *size);
Kojto 71:53949e6131f6 254 void R_USB_api_function_clear_pipe_status(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 255 void R_USB_api_function_start_receive_transfer(uint16_t root, uint16_t pipe, uint32_t size, uint8_t *data);
Kojto 71:53949e6131f6 256 void R_USB_api_function_set_pid_buf(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 257 void R_USB_api_function_set_pid_nak(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 258 void R_USB_api_function_set_pid_stall(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 259 void R_USB_api_function_clear_pid_stall(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 260 uint16_t R_USB_api_function_get_pid(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 261 int32_t R_USB_api_function_check_stall(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 262 void R_USB_api_function_set_sqclr(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 263 void R_USB_api_function_set_sqset(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 264 void R_USB_api_function_set_csclr(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 265 void R_USB_api_function_set_curpipe(uint16_t root, uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
Kojto 71:53949e6131f6 266 void R_USB_api_function_clear_brdy_sts(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 267 void R_USB_api_function_clear_bemp_sts(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 268 void R_USB_api_function_clear_nrdy_sts(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 269 void R_USB_api_function_enable_brdy_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 270 void R_USB_api_function_disable_brdy_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 271 void R_USB_api_function_enable_bemp_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 272 void R_USB_api_function_disable_bemp_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 273 void R_USB_api_function_enable_nrdy_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 274 void R_USB_api_function_disable_nrdy_int(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 275 void R_USB_api_function_stop_transfer(uint16_t root, uint16_t pipe);
Kojto 71:53949e6131f6 276 #endif
Kojto 71:53949e6131f6 277
Kojto 71:53949e6131f6 278 #ifdef USB0_FUNCTION_API_H
Kojto 71:53949e6131f6 279 void usb0_function_interrupt(uint32_t int_sense);
Kojto 71:53949e6131f6 280 void usb0_function_dma_interrupt_d0fifo(uint32_t int_sense);
Kojto 71:53949e6131f6 281 void usb0_function_dma_interrupt_d1fifo(uint32_t int_sense);
Kojto 71:53949e6131f6 282
Kojto 71:53949e6131f6 283 void usb0_function_Class0(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 284 void usb0_function_Class1(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 285 void usb0_function_Class2(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 286 void usb0_function_Class3(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 287 void usb0_function_Class4(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 288 void usb0_function_Class5(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 289 void usb0_function_Vendor0(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 290 void usb0_function_Vendor1(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 291 void usb0_function_Vendor2(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 292 void usb0_function_Vendor3(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 293 void usb0_function_Vendor4(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 294 void usb0_function_Vendor5(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 295 void usb0_function_ResetDescriptor(uint16_t mode);
Kojto 71:53949e6131f6 296
Kojto 71:53949e6131f6 297 IRQn_Type Userdef_USB_usb0_function_d0fifo_dmaintid(void);
Kojto 71:53949e6131f6 298 IRQn_Type Userdef_USB_usb0_function_d1fifo_dmaintid(void);
Kojto 71:53949e6131f6 299 void Userdef_USB_usb0_function_attach(void);
Kojto 71:53949e6131f6 300 void Userdef_USB_usb0_function_detach(void);
Kojto 71:53949e6131f6 301 void Userdef_USB_usb0_function_delay_1ms(void);
Kojto 71:53949e6131f6 302 void Userdef_USB_usb0_function_delay_xms(uint32_t msec);
Kojto 71:53949e6131f6 303 void Userdef_USB_usb0_function_delay_10us(uint32_t usec);
Kojto 71:53949e6131f6 304 void Userdef_USB_usb0_function_delay_500ns(void);
Kojto 71:53949e6131f6 305 void Userdef_USB_usb0_function_start_dma(USB_FUNCTION_DMA_t *dma, uint16_t dfacc);
Kojto 71:53949e6131f6 306 uint32_t Userdef_USB_usb0_function_stop_dma0(void);
Kojto 71:53949e6131f6 307 uint32_t Userdef_USB_usb0_function_stop_dma1(void);
Kojto 71:53949e6131f6 308
Kojto 71:53949e6131f6 309 void usb0_function_stop_transfer(uint16_t pipe);
Kojto 71:53949e6131f6 310 void usb0_function_enable_brdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 311 void usb0_function_disable_brdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 312 void usb0_function_enable_bemp_int(uint16_t pipe);
Kojto 71:53949e6131f6 313 void usb0_function_disable_bemp_int(uint16_t pipe);
Kojto 71:53949e6131f6 314 void usb0_function_enable_nrdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 315 void usb0_function_disable_nrdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 316 #endif
Kojto 71:53949e6131f6 317
Kojto 71:53949e6131f6 318 #ifdef USB1_FUNCTION_API_H
Kojto 71:53949e6131f6 319 void usb1_function_interrupt(uint32_t int_sense);
Kojto 71:53949e6131f6 320 void usb1_function_dma_interrupt_d0fifo(uint32_t int_sense);
Kojto 71:53949e6131f6 321 void usb1_function_dma_interrupt_d1fifo(uint32_t int_sense);
Kojto 71:53949e6131f6 322
Kojto 71:53949e6131f6 323 void usb1_function_Class0(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 324 void usb1_function_Class1(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 325 void usb1_function_Class2(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 326 void usb1_function_Class3(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 327 void usb1_function_Class4(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 328 void usb1_function_Class5(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 329 void usb1_function_Vendor0(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 330 void usb1_function_Vendor1(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 331 void usb1_function_Vendor2(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 332 void usb1_function_Vendor3(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 333 void usb1_function_Vendor4(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 334 void usb1_function_Vendor5(uint16_t type, uint16_t req, uint16_t value, uint16_t index, uint16_t length);
Kojto 71:53949e6131f6 335 void usb1_function_ResetDescriptor(uint16_t mode);
Kojto 71:53949e6131f6 336
Kojto 71:53949e6131f6 337 IRQn_Type Userdef_USB_usb1_function_d0fifo_dmaintid(void);
Kojto 71:53949e6131f6 338 IRQn_Type Userdef_USB_usb1_function_d1fifo_dmaintid(void);
Kojto 71:53949e6131f6 339 void Userdef_USB_usb1_function_attach(void);
Kojto 71:53949e6131f6 340 void Userdef_USB_usb1_function_detach(void);
Kojto 71:53949e6131f6 341 void Userdef_USB_usb1_function_delay_1ms(void);
Kojto 71:53949e6131f6 342 void Userdef_USB_usb1_function_delay_xms(uint32_t msec);
Kojto 71:53949e6131f6 343 void Userdef_USB_usb1_function_delay_10us(uint32_t usec);
Kojto 71:53949e6131f6 344 void Userdef_USB_usb1_function_delay_500ns(void);
Kojto 71:53949e6131f6 345 void Userdef_USB_usb1_function_start_dma(USB_FUNCTION_DMA_t *dma, uint16_t dfacc);
Kojto 71:53949e6131f6 346 uint32_t Userdef_USB_usb1_function_stop_dma0(void);
Kojto 71:53949e6131f6 347 uint32_t Userdef_USB_usb1_function_stop_dma1(void);
Kojto 71:53949e6131f6 348
Kojto 71:53949e6131f6 349 void usb1_function_stop_transfer(uint16_t pipe);
Kojto 71:53949e6131f6 350 void usb1_function_enable_brdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 351 void usb1_function_disable_brdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 352 void usb1_function_enable_bemp_int(uint16_t pipe);
Kojto 71:53949e6131f6 353 void usb1_function_disable_bemp_int(uint16_t pipe);
Kojto 71:53949e6131f6 354 void usb1_function_enable_nrdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 355 void usb1_function_disable_nrdy_int(uint16_t pipe);
Kojto 71:53949e6131f6 356 #endif
Kojto 71:53949e6131f6 357
Kojto 71:53949e6131f6 358 #ifdef __cplusplus
Kojto 71:53949e6131f6 359 }
Kojto 71:53949e6131f6 360 #endif
Kojto 71:53949e6131f6 361
Kojto 71:53949e6131f6 362
Kojto 71:53949e6131f6 363 #endif /* USB_FUNCTION_API_H */
Kojto 71:53949e6131f6 364
Kojto 71:53949e6131f6 365 /* End of File */