USBDevice with MAX32620HSP platform support

Fork of USBDevice by mbed official

Committer:
mbed_official
Date:
Fri Apr 29 01:16:25 2016 +0100
Revision:
62:c1549af978d6
Synchronized with git revision fe9720f24b1adc71ab6962506ec51290f6afd270

Full URL: https://github.com/mbedmicro/mbed/commit/fe9720f24b1adc71ab6962506ec51290f6afd270/

[Renesas RZ/A1H] Enable asynchronous communications

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 62:c1549af978d6 1 /*******************************************************************************
mbed_official 62:c1549af978d6 2 * DISCLAIMER
mbed_official 62:c1549af978d6 3 * This software is supplied by Renesas Electronics Corporation and is only
mbed_official 62:c1549af978d6 4 * intended for use with Renesas products. No other uses are authorized. This
mbed_official 62:c1549af978d6 5 * software is owned by Renesas Electronics Corporation and is protected under
mbed_official 62:c1549af978d6 6 * all applicable laws, including copyright laws.
mbed_official 62:c1549af978d6 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
mbed_official 62:c1549af978d6 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
mbed_official 62:c1549af978d6 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
mbed_official 62:c1549af978d6 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
mbed_official 62:c1549af978d6 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
mbed_official 62:c1549af978d6 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
mbed_official 62:c1549af978d6 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
mbed_official 62:c1549af978d6 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
mbed_official 62:c1549af978d6 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mbed_official 62:c1549af978d6 16 * Renesas reserves the right, without notice, to make changes to this software
mbed_official 62:c1549af978d6 17 * and to discontinue the availability of this software. By using this software,
mbed_official 62:c1549af978d6 18 * you agree to the additional terms and conditions found by accessing the
mbed_official 62:c1549af978d6 19 * following link:
mbed_official 62:c1549af978d6 20 * http://www.renesas.com/disclaimer
mbed_official 62:c1549af978d6 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
mbed_official 62:c1549af978d6 22 *******************************************************************************/
mbed_official 62:c1549af978d6 23 /*******************************************************************************
mbed_official 62:c1549af978d6 24 * File Name : usb1_function_sig.c
mbed_official 62:c1549af978d6 25 * $Rev: 1116 $
mbed_official 62:c1549af978d6 26 * $Date:: 2014-07-09 16:29:19 +0900#$
mbed_official 62:c1549af978d6 27 * Device(s) : RZ/A1H
mbed_official 62:c1549af978d6 28 * Tool-Chain :
mbed_official 62:c1549af978d6 29 * OS : None
mbed_official 62:c1549af978d6 30 * H/W Platform :
mbed_official 62:c1549af978d6 31 * Description : RZ/A1H R7S72100 USB Sample Program
mbed_official 62:c1549af978d6 32 * Operation :
mbed_official 62:c1549af978d6 33 * Limitations :
mbed_official 62:c1549af978d6 34 *******************************************************************************/
mbed_official 62:c1549af978d6 35
mbed_official 62:c1549af978d6 36
mbed_official 62:c1549af978d6 37 /*******************************************************************************
mbed_official 62:c1549af978d6 38 Includes <System Includes> , "Project Includes"
mbed_official 62:c1549af978d6 39 *******************************************************************************/
mbed_official 62:c1549af978d6 40 #include "usb1_function.h"
mbed_official 62:c1549af978d6 41
mbed_official 62:c1549af978d6 42
mbed_official 62:c1549af978d6 43 /*******************************************************************************
mbed_official 62:c1549af978d6 44 Typedef definitions
mbed_official 62:c1549af978d6 45 *******************************************************************************/
mbed_official 62:c1549af978d6 46
mbed_official 62:c1549af978d6 47
mbed_official 62:c1549af978d6 48 /*******************************************************************************
mbed_official 62:c1549af978d6 49 Macro definitions
mbed_official 62:c1549af978d6 50 *******************************************************************************/
mbed_official 62:c1549af978d6 51
mbed_official 62:c1549af978d6 52
mbed_official 62:c1549af978d6 53 /*******************************************************************************
mbed_official 62:c1549af978d6 54 Imported global variables and functions (from other files)
mbed_official 62:c1549af978d6 55 *******************************************************************************/
mbed_official 62:c1549af978d6 56
mbed_official 62:c1549af978d6 57
mbed_official 62:c1549af978d6 58 /*******************************************************************************
mbed_official 62:c1549af978d6 59 Exported global variables and functions (to be accessed by other files)
mbed_official 62:c1549af978d6 60 *******************************************************************************/
mbed_official 62:c1549af978d6 61 static void usb1_function_EnableINTModule(void);
mbed_official 62:c1549af978d6 62
mbed_official 62:c1549af978d6 63
mbed_official 62:c1549af978d6 64 /*******************************************************************************
mbed_official 62:c1549af978d6 65 Private global variables and functions
mbed_official 62:c1549af978d6 66 *******************************************************************************/
mbed_official 62:c1549af978d6 67
mbed_official 62:c1549af978d6 68
mbed_official 62:c1549af978d6 69 /*******************************************************************************
mbed_official 62:c1549af978d6 70 * Function Name: usb1_function_InitModule
mbed_official 62:c1549af978d6 71 * Description : Initializes the USB module in the USB function mode.
mbed_official 62:c1549af978d6 72 * Arguments : uint16_t mode ; USB_FUNCTION_HIGH_SPEED ; Hi-Speed Mode
mbed_official 62:c1549af978d6 73 * : ; other ; Full-speed Mode
mbed_official 62:c1549af978d6 74 * Return Value : none
mbed_official 62:c1549af978d6 75 *******************************************************************************/
mbed_official 62:c1549af978d6 76 void usb1_function_InitModule (uint16_t mode)
mbed_official 62:c1549af978d6 77 {
mbed_official 62:c1549af978d6 78 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 79 0,
mbed_official 62:c1549af978d6 80 USB_SYSCFG_DCFM_SHIFT,
mbed_official 62:c1549af978d6 81 USB_SYSCFG_DCFM); /* USB function */
mbed_official 62:c1549af978d6 82
mbed_official 62:c1549af978d6 83 /* USB module operation enabled */
mbed_official 62:c1549af978d6 84 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 85 1,
mbed_official 62:c1549af978d6 86 USB_SYSCFG_USBE_SHIFT,
mbed_official 62:c1549af978d6 87 USB_SYSCFG_USBE);
mbed_official 62:c1549af978d6 88
mbed_official 62:c1549af978d6 89 if (mode == USB_FUNCTION_HIGH_SPEED)
mbed_official 62:c1549af978d6 90 {
mbed_official 62:c1549af978d6 91 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 92 1,
mbed_official 62:c1549af978d6 93 USB_SYSCFG_HSE_SHIFT,
mbed_official 62:c1549af978d6 94 USB_SYSCFG_HSE); /* Hi-Speed Mode */
mbed_official 62:c1549af978d6 95 }
mbed_official 62:c1549af978d6 96 else
mbed_official 62:c1549af978d6 97 {
mbed_official 62:c1549af978d6 98 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 99 0,
mbed_official 62:c1549af978d6 100 USB_SYSCFG_HSE_SHIFT,
mbed_official 62:c1549af978d6 101 USB_SYSCFG_HSE);
mbed_official 62:c1549af978d6 102 }
mbed_official 62:c1549af978d6 103
mbed_official 62:c1549af978d6 104 /* for power-on */
mbed_official 62:c1549af978d6 105 if (usb1_function_CheckVBUStaus() == DEVDRV_USBF_ON)
mbed_official 62:c1549af978d6 106 {
mbed_official 62:c1549af978d6 107 usb1_function_EnableINTModule(); /* Interrupt Enable */
mbed_official 62:c1549af978d6 108 usb1_function_USB_FUNCTION_Attach(); /* pull-up D+ and open D- */
mbed_official 62:c1549af978d6 109 }
mbed_official 62:c1549af978d6 110 else
mbed_official 62:c1549af978d6 111 {
mbed_official 62:c1549af978d6 112 usb1_function_USB_FUNCTION_Detach(); /* USB Detach */
mbed_official 62:c1549af978d6 113 /* with Interrupt Enable */
mbed_official 62:c1549af978d6 114 }
mbed_official 62:c1549af978d6 115 }
mbed_official 62:c1549af978d6 116
mbed_official 62:c1549af978d6 117 /*******************************************************************************
mbed_official 62:c1549af978d6 118 * Function Name: usb1_function_CheckVBUStaus
mbed_official 62:c1549af978d6 119 * Description : Checks the USB-VBUS state to returns the connection state to
mbed_official 62:c1549af978d6 120 * : the USB host.
mbed_official 62:c1549af978d6 121 * Arguments : none
mbed_official 62:c1549af978d6 122 * Return Value : DEVDRV_USBF_ON : VBUS ON
mbed_official 62:c1549af978d6 123 * : DEVDRV_USBF_OFF : VBUS OFF
mbed_official 62:c1549af978d6 124 *******************************************************************************/
mbed_official 62:c1549af978d6 125 uint16_t usb1_function_CheckVBUStaus (void)
mbed_official 62:c1549af978d6 126 {
mbed_official 62:c1549af978d6 127 uint16_t buf1;
mbed_official 62:c1549af978d6 128 uint16_t buf2;
mbed_official 62:c1549af978d6 129 uint16_t buf3;
mbed_official 62:c1549af978d6 130
mbed_official 62:c1549af978d6 131 /* monitor VBUS pins */
mbed_official 62:c1549af978d6 132 do
mbed_official 62:c1549af978d6 133 {
mbed_official 62:c1549af978d6 134 buf1 = RZA_IO_RegRead_16(&USB201.INTSTS0,
mbed_official 62:c1549af978d6 135 USB_INTSTS0_VBSTS_SHIFT,
mbed_official 62:c1549af978d6 136 USB_INTSTS0_VBSTS);
mbed_official 62:c1549af978d6 137 Userdef_USB_usb1_function_delay_10us(1);
mbed_official 62:c1549af978d6 138 buf2 = RZA_IO_RegRead_16(&USB201.INTSTS0,
mbed_official 62:c1549af978d6 139 USB_INTSTS0_VBSTS_SHIFT,
mbed_official 62:c1549af978d6 140 USB_INTSTS0_VBSTS);
mbed_official 62:c1549af978d6 141 Userdef_USB_usb1_function_delay_10us(1);
mbed_official 62:c1549af978d6 142 buf3 = RZA_IO_RegRead_16(&USB201.INTSTS0,
mbed_official 62:c1549af978d6 143 USB_INTSTS0_VBSTS_SHIFT,
mbed_official 62:c1549af978d6 144 USB_INTSTS0_VBSTS);
mbed_official 62:c1549af978d6 145 } while ((buf1 != buf2) || (buf2 != buf3));
mbed_official 62:c1549af978d6 146
mbed_official 62:c1549af978d6 147 if (buf1 == DEVDRV_USBF_OFF)
mbed_official 62:c1549af978d6 148 {
mbed_official 62:c1549af978d6 149 return DEVDRV_USBF_OFF; /* detach */
mbed_official 62:c1549af978d6 150 }
mbed_official 62:c1549af978d6 151
mbed_official 62:c1549af978d6 152 return DEVDRV_USBF_ON; /* attach */
mbed_official 62:c1549af978d6 153 }
mbed_official 62:c1549af978d6 154
mbed_official 62:c1549af978d6 155 /*******************************************************************************
mbed_official 62:c1549af978d6 156 * Function Name: usb1_function_USB_FUNCTION_Attach
mbed_official 62:c1549af978d6 157 * Description : Connects to the USB host controller.
mbed_official 62:c1549af978d6 158 * : This function pulls up D+.
mbed_official 62:c1549af978d6 159 * Arguments : none
mbed_official 62:c1549af978d6 160 * Return Value : none
mbed_official 62:c1549af978d6 161 *******************************************************************************/
mbed_official 62:c1549af978d6 162 void usb1_function_USB_FUNCTION_Attach (void)
mbed_official 62:c1549af978d6 163 {
mbed_official 62:c1549af978d6 164 Userdef_USB_usb1_function_attach();
mbed_official 62:c1549af978d6 165
mbed_official 62:c1549af978d6 166 Userdef_USB_usb1_function_delay_xms(10);
mbed_official 62:c1549af978d6 167
mbed_official 62:c1549af978d6 168 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 169 1,
mbed_official 62:c1549af978d6 170 USB_SYSCFG_DPRPU_SHIFT,
mbed_official 62:c1549af978d6 171 USB_SYSCFG_DPRPU); /* Pull-up D+ and open D- */
mbed_official 62:c1549af978d6 172 }
mbed_official 62:c1549af978d6 173
mbed_official 62:c1549af978d6 174 /*******************************************************************************
mbed_official 62:c1549af978d6 175 * Function Name: usb1_function_USB_FUNCTION_Detach
mbed_official 62:c1549af978d6 176 * Description : Disconnects from the USB host controller.
mbed_official 62:c1549af978d6 177 * : This function opens D+/D-.
mbed_official 62:c1549af978d6 178 * Arguments : none
mbed_official 62:c1549af978d6 179 * Return Value : none
mbed_official 62:c1549af978d6 180 *******************************************************************************/
mbed_official 62:c1549af978d6 181 void usb1_function_USB_FUNCTION_Detach (void)
mbed_official 62:c1549af978d6 182 {
mbed_official 62:c1549af978d6 183 uint16_t pipe;
mbed_official 62:c1549af978d6 184
mbed_official 62:c1549af978d6 185 Userdef_USB_usb1_function_detach();
mbed_official 62:c1549af978d6 186
mbed_official 62:c1549af978d6 187 for (pipe = 0; pipe < (USB_FUNCTION_MAX_PIPE_NO + 1); ++pipe)
mbed_official 62:c1549af978d6 188 {
mbed_official 62:c1549af978d6 189 if (g_usb1_function_pipe_status[pipe] != DEVDRV_USBF_PIPE_IDLE)
mbed_official 62:c1549af978d6 190 {
mbed_official 62:c1549af978d6 191 usb1_function_stop_transfer(pipe);
mbed_official 62:c1549af978d6 192 }
mbed_official 62:c1549af978d6 193 }
mbed_official 62:c1549af978d6 194
mbed_official 62:c1549af978d6 195 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 196 0,
mbed_official 62:c1549af978d6 197 USB_SYSCFG_DPRPU_SHIFT,
mbed_official 62:c1549af978d6 198 USB_SYSCFG_DPRPU); /* open D+ and D- */
mbed_official 62:c1549af978d6 199
mbed_official 62:c1549af978d6 200 /* Detach Recovery */
mbed_official 62:c1549af978d6 201 Userdef_USB_usb1_function_delay_500ns(); /* need 1us=500ns * 2 wait */
mbed_official 62:c1549af978d6 202 Userdef_USB_usb1_function_delay_500ns();
mbed_official 62:c1549af978d6 203
mbed_official 62:c1549af978d6 204 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 205 1,
mbed_official 62:c1549af978d6 206 USB_SYSCFG_DCFM_SHIFT,
mbed_official 62:c1549af978d6 207 USB_SYSCFG_DCFM);
mbed_official 62:c1549af978d6 208 Userdef_USB_usb1_function_delay_500ns(); /* need 100ns wait but 500ns S/W wait */
mbed_official 62:c1549af978d6 209
mbed_official 62:c1549af978d6 210 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 211 0,
mbed_official 62:c1549af978d6 212 USB_SYSCFG_DCFM_SHIFT,
mbed_official 62:c1549af978d6 213 USB_SYSCFG_DCFM);
mbed_official 62:c1549af978d6 214
mbed_official 62:c1549af978d6 215 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 216 0,
mbed_official 62:c1549af978d6 217 USB_SYSCFG_USBE_SHIFT,
mbed_official 62:c1549af978d6 218 USB_SYSCFG_USBE); /* soft reset module */
mbed_official 62:c1549af978d6 219 Userdef_USB_usb1_function_delay_500ns();
mbed_official 62:c1549af978d6 220
mbed_official 62:c1549af978d6 221 RZA_IO_RegWrite_16(&USB201.SYSCFG0,
mbed_official 62:c1549af978d6 222 1,
mbed_official 62:c1549af978d6 223 USB_SYSCFG_USBE_SHIFT,
mbed_official 62:c1549af978d6 224 USB_SYSCFG_USBE);
mbed_official 62:c1549af978d6 225
mbed_official 62:c1549af978d6 226 usb1_function_EnableINTModule(); /* Interrupt Enable */
mbed_official 62:c1549af978d6 227 }
mbed_official 62:c1549af978d6 228
mbed_official 62:c1549af978d6 229 /*******************************************************************************
mbed_official 62:c1549af978d6 230 * Function Name: usb1_function_USB_FUNCTION_BusReset
mbed_official 62:c1549af978d6 231 * Description : This function is executed when the USB device is transitioned
mbed_official 62:c1549af978d6 232 * : to POWERD_STATE. Sets the device descriptor according to the
mbed_official 62:c1549af978d6 233 * : connection speed determined by the USB reset hand shake.
mbed_official 62:c1549af978d6 234 * Arguments : none
mbed_official 62:c1549af978d6 235 * Return Value : none
mbed_official 62:c1549af978d6 236 *******************************************************************************/
mbed_official 62:c1549af978d6 237 #if 0 /*The USBHAL in mbed does not need this function*/
mbed_official 62:c1549af978d6 238 void usb1_function_USB_FUNCTION_BusReset (void)
mbed_official 62:c1549af978d6 239 {
mbed_official 62:c1549af978d6 240 usb1_function_init_status(); /* memory clear */
mbed_official 62:c1549af978d6 241
mbed_official 62:c1549af978d6 242 if (usb1_function_is_hispeed() == USB_FUNCTION_HIGH_SPEED)
mbed_official 62:c1549af978d6 243 {
mbed_official 62:c1549af978d6 244 usb1_function_ResetDescriptor(USB_FUNCTION_HIGH_SPEED); /* Device Descriptor reset */
mbed_official 62:c1549af978d6 245 }
mbed_official 62:c1549af978d6 246 else
mbed_official 62:c1549af978d6 247 {
mbed_official 62:c1549af978d6 248 usb1_function_ResetDescriptor(USB_FUNCTION_FULL_SPEED); /* Device Descriptor reset */
mbed_official 62:c1549af978d6 249 }
mbed_official 62:c1549af978d6 250
mbed_official 62:c1549af978d6 251 usb1_function_ResetDCP(); /* Default Control PIPE reset */
mbed_official 62:c1549af978d6 252 }
mbed_official 62:c1549af978d6 253 #endif
mbed_official 62:c1549af978d6 254
mbed_official 62:c1549af978d6 255 /*******************************************************************************
mbed_official 62:c1549af978d6 256 * Function Name: usb1_function_USB_FUNCTION_Resume
mbed_official 62:c1549af978d6 257 * Description : This function is executed when the USB device detects a resume
mbed_official 62:c1549af978d6 258 * : signal.
mbed_official 62:c1549af978d6 259 * : The USB sample driver does not operate for this function.
mbed_official 62:c1549af978d6 260 * Arguments : none
mbed_official 62:c1549af978d6 261 * Return Value : none
mbed_official 62:c1549af978d6 262 *******************************************************************************/
mbed_official 62:c1549af978d6 263 #if 0 /*The USBHAL in mbed does not need this function*/
mbed_official 62:c1549af978d6 264 void usb1_function_USB_FUNCTION_Resume (void)
mbed_official 62:c1549af978d6 265 {
mbed_official 62:c1549af978d6 266 /* NOP */
mbed_official 62:c1549af978d6 267 }
mbed_official 62:c1549af978d6 268 #endif
mbed_official 62:c1549af978d6 269
mbed_official 62:c1549af978d6 270 /*******************************************************************************
mbed_official 62:c1549af978d6 271 * Function Name: usb1_function_USB_FUNCTION_Suspend
mbed_official 62:c1549af978d6 272 * Description : This function is executed when the USB device detects a suspend
mbed_official 62:c1549af978d6 273 * : signal.
mbed_official 62:c1549af978d6 274 * : The USB sample driver does not operate for this function.
mbed_official 62:c1549af978d6 275 * Arguments : none
mbed_official 62:c1549af978d6 276 * Return Value : none
mbed_official 62:c1549af978d6 277 *******************************************************************************/
mbed_official 62:c1549af978d6 278 #if 0 /*The USBHAL in mbed does not need this function*/
mbed_official 62:c1549af978d6 279 void usb1_function_USB_FUNCTION_Suspend (void)
mbed_official 62:c1549af978d6 280 {
mbed_official 62:c1549af978d6 281 /* NOP */
mbed_official 62:c1549af978d6 282 }
mbed_official 62:c1549af978d6 283 #endif
mbed_official 62:c1549af978d6 284
mbed_official 62:c1549af978d6 285 /*******************************************************************************
mbed_official 62:c1549af978d6 286 * Function Name: usb1_function_USB_FUNCTION_TestMode
mbed_official 62:c1549af978d6 287 * Description : This function is executed when the USB device is transitioned U
mbed_official 62:c1549af978d6 288 * : to TEST_MODE by the USB standard request.
mbed_official 62:c1549af978d6 289 * Arguments : none
mbed_official 62:c1549af978d6 290 * Return Value : none
mbed_official 62:c1549af978d6 291 *******************************************************************************/
mbed_official 62:c1549af978d6 292 void usb1_function_USB_FUNCTION_TestMode (void)
mbed_official 62:c1549af978d6 293 {
mbed_official 62:c1549af978d6 294 switch (g_usb1_function_TestModeSelectors & USB_FUNCTION_FUNCTION_TEST_SELECT)
mbed_official 62:c1549af978d6 295 {
mbed_official 62:c1549af978d6 296 case USB_FUNCTION_FUNCTION_TEST_J:
mbed_official 62:c1549af978d6 297 case USB_FUNCTION_FUNCTION_TEST_K:
mbed_official 62:c1549af978d6 298 case USB_FUNCTION_FUNCTION_TEST_SE0_NAK:
mbed_official 62:c1549af978d6 299 case USB_FUNCTION_FUNCTION_TEST_PACKET:
mbed_official 62:c1549af978d6 300 RZA_IO_RegWrite_16(&USB201.TESTMODE,
mbed_official 62:c1549af978d6 301 (g_usb1_function_TestModeSelectors >> 8),
mbed_official 62:c1549af978d6 302 USB_TESTMODE_UTST_SHIFT,
mbed_official 62:c1549af978d6 303 USB_TESTMODE_UTST);
mbed_official 62:c1549af978d6 304 break;
mbed_official 62:c1549af978d6 305
mbed_official 62:c1549af978d6 306 case USB_FUNCTION_FUNCTION_TEST_FORCE_ENABLE:
mbed_official 62:c1549af978d6 307 default:
mbed_official 62:c1549af978d6 308 break;
mbed_official 62:c1549af978d6 309 }
mbed_official 62:c1549af978d6 310 }
mbed_official 62:c1549af978d6 311
mbed_official 62:c1549af978d6 312 /*******************************************************************************
mbed_official 62:c1549af978d6 313 * Function Name: usb1_function_EnableINTModule
mbed_official 62:c1549af978d6 314 * Description : Enables USB interrupt.
mbed_official 62:c1549af978d6 315 * Arguments : none
mbed_official 62:c1549af978d6 316 * Return Value : none
mbed_official 62:c1549af978d6 317 *******************************************************************************/
mbed_official 62:c1549af978d6 318 static void usb1_function_EnableINTModule (void)
mbed_official 62:c1549af978d6 319 {
mbed_official 62:c1549af978d6 320 uint16_t buf;
mbed_official 62:c1549af978d6 321
mbed_official 62:c1549af978d6 322 buf = USB201.INTENB0;
mbed_official 62:c1549af978d6 323 buf |= (USB_FUNCTION_BITVBSE | USB_FUNCTION_BITDVSE | USB_FUNCTION_BITCTRE |
mbed_official 62:c1549af978d6 324 USB_FUNCTION_BITBEMPE | USB_FUNCTION_BITNRDYE | USB_FUNCTION_BITBRDYE);
mbed_official 62:c1549af978d6 325 USB201.INTENB0 = buf;
mbed_official 62:c1549af978d6 326
mbed_official 62:c1549af978d6 327 usb1_function_enable_bemp_int(USB_FUNCTION_PIPE0);
mbed_official 62:c1549af978d6 328 }
mbed_official 62:c1549af978d6 329
mbed_official 62:c1549af978d6 330 /* End of File */