1st Release
Fork of USBDevice by
USBDevice/TARGET_RENESAS/TARGET_VK_RZ_A1H/usb1/src/function/usb1_function_global.c@62:c1549af978d6, 2016-04-29 (annotated)
- 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?
User | Revision | Line number | New 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_global.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 | |
mbed_official | 62:c1549af978d6 | 62 | |
mbed_official | 62:c1549af978d6 | 63 | /******************************************************************************* |
mbed_official | 62:c1549af978d6 | 64 | Private global variables and functions |
mbed_official | 62:c1549af978d6 | 65 | *******************************************************************************/ |
mbed_official | 62:c1549af978d6 | 66 | const uint16_t g_usb1_function_bit_set[16] = |
mbed_official | 62:c1549af978d6 | 67 | { |
mbed_official | 62:c1549af978d6 | 68 | 0x0001, 0x0002, 0x0004, 0x0008, |
mbed_official | 62:c1549af978d6 | 69 | 0x0010, 0x0020, 0x0040, 0x0080, |
mbed_official | 62:c1549af978d6 | 70 | 0x0100, 0x0200, 0x0400, 0x0800, |
mbed_official | 62:c1549af978d6 | 71 | 0x1000, 0x2000, 0x4000, 0x8000 |
mbed_official | 62:c1549af978d6 | 72 | }; |
mbed_official | 62:c1549af978d6 | 73 | |
mbed_official | 62:c1549af978d6 | 74 | uint32_t g_usb1_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 75 | uint8_t * g_usb1_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 76 | |
mbed_official | 62:c1549af978d6 | 77 | uint16_t g_usb1_function_PipeIgnore[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 78 | uint16_t g_usb1_function_PipeTbl[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 79 | uint16_t g_usb1_function_pipe_status[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 80 | uint32_t g_usb1_function_PipeDataSize[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 81 | |
mbed_official | 62:c1549af978d6 | 82 | USB_FUNCTION_DMA_t g_usb1_function_DmaInfo[2]; |
mbed_official | 62:c1549af978d6 | 83 | uint16_t g_usb1_function_DmaPipe[2]; |
mbed_official | 62:c1549af978d6 | 84 | uint16_t g_usb1_function_DmaBval[2]; |
mbed_official | 62:c1549af978d6 | 85 | uint16_t g_usb1_function_DmaStatus[2]; |
mbed_official | 62:c1549af978d6 | 86 | |
mbed_official | 62:c1549af978d6 | 87 | uint16_t g_usb1_function_CtrZeroLengthFlag; |
mbed_official | 62:c1549af978d6 | 88 | |
mbed_official | 62:c1549af978d6 | 89 | //uint16_t g_usb1_function_ConfigNum; |
mbed_official | 62:c1549af978d6 | 90 | //uint16_t g_usb1_function_Alternate[USB_FUNCTION_ALT_NO]; |
mbed_official | 62:c1549af978d6 | 91 | //uint16_t g_usb1_function_RemoteWakeupFlag; |
mbed_official | 62:c1549af978d6 | 92 | uint16_t g_usb1_function_TestModeFlag; |
mbed_official | 62:c1549af978d6 | 93 | uint16_t g_usb1_function_TestModeSelectors; |
mbed_official | 62:c1549af978d6 | 94 | |
mbed_official | 62:c1549af978d6 | 95 | //uint16_t g_usb1_function_ReqType; |
mbed_official | 62:c1549af978d6 | 96 | //uint16_t g_usb1_function_ReqTypeType; |
mbed_official | 62:c1549af978d6 | 97 | //uint16_t g_usb1_function_ReqTypeRecip; |
mbed_official | 62:c1549af978d6 | 98 | //uint16_t g_usb1_function_ReqRequest; |
mbed_official | 62:c1549af978d6 | 99 | //uint16_t g_usb1_function_ReqValue; |
mbed_official | 62:c1549af978d6 | 100 | //uint16_t g_usb1_function_ReqIndex; |
mbed_official | 62:c1549af978d6 | 101 | //uint16_t g_usb1_function_ReqLength; |
mbed_official | 62:c1549af978d6 | 102 | |
mbed_official | 62:c1549af978d6 | 103 | //uint16_t g_usb1_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1]; |
mbed_official | 62:c1549af978d6 | 104 | |
mbed_official | 62:c1549af978d6 | 105 | uint16_t g_usb1_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 106 | uint16_t g_usb1_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 107 | uint16_t g_usb1_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 108 | uint16_t g_usb1_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 62:c1549af978d6 | 109 | |
mbed_official | 62:c1549af978d6 | 110 | |
mbed_official | 62:c1549af978d6 | 111 | /******************************************************************************* |
mbed_official | 62:c1549af978d6 | 112 | * Function Name: usb1_function_init_status |
mbed_official | 62:c1549af978d6 | 113 | * Description : Initialization USB Sample Driver Variable. |
mbed_official | 62:c1549af978d6 | 114 | * Arguments : none |
mbed_official | 62:c1549af978d6 | 115 | * Return Value : none |
mbed_official | 62:c1549af978d6 | 116 | *******************************************************************************/ |
mbed_official | 62:c1549af978d6 | 117 | void usb1_function_init_status (void) |
mbed_official | 62:c1549af978d6 | 118 | { |
mbed_official | 62:c1549af978d6 | 119 | uint16_t pipe; |
mbed_official | 62:c1549af978d6 | 120 | |
mbed_official | 62:c1549af978d6 | 121 | //g_usb1_function_ConfigNum = 0; |
mbed_official | 62:c1549af978d6 | 122 | //g_usb1_function_RemoteWakeupFlag = DEVDRV_USBF_OFF; |
mbed_official | 62:c1549af978d6 | 123 | g_usb1_function_TestModeFlag = DEVDRV_USBF_OFF; |
mbed_official | 62:c1549af978d6 | 124 | g_usb1_function_CtrZeroLengthFlag = 0; |
mbed_official | 62:c1549af978d6 | 125 | |
mbed_official | 62:c1549af978d6 | 126 | #if 0 |
mbed_official | 62:c1549af978d6 | 127 | usb1_function_clear_alt(); |
mbed_official | 62:c1549af978d6 | 128 | #endif |
mbed_official | 62:c1549af978d6 | 129 | |
mbed_official | 62:c1549af978d6 | 130 | for (pipe = 0; pipe < (USB_FUNCTION_MAX_PIPE_NO + 1); ++pipe) |
mbed_official | 62:c1549af978d6 | 131 | { |
mbed_official | 62:c1549af978d6 | 132 | g_usb1_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE; |
mbed_official | 62:c1549af978d6 | 133 | g_usb1_function_PipeDataSize[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 134 | g_usb1_function_data_count[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 135 | |
mbed_official | 62:c1549af978d6 | 136 | /* pipe configuration in usb1_function_ResetEP() */ |
mbed_official | 62:c1549af978d6 | 137 | g_usb1_function_pipecfg[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 138 | g_usb1_function_pipebuf[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 139 | g_usb1_function_pipemaxp[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 140 | g_usb1_function_pipeperi[pipe] = 0; |
mbed_official | 62:c1549af978d6 | 141 | } |
mbed_official | 62:c1549af978d6 | 142 | } |
mbed_official | 62:c1549af978d6 | 143 | |
mbed_official | 62:c1549af978d6 | 144 | /* End of File */ |