USB device stack - Added support for the logo/windows key to USB keyboard.

Dependents:   randomSearch

Fork of USBDevice by mbed official

Committer:
mbed_official
Date:
Tue Mar 31 16:15:39 2015 +0100
Revision:
46:378357d7e90d
Synchronized with git revision 251f3f8b55a4dc98b831c80e032464ed45cce309

Full URL: https://github.com/mbedmicro/mbed/commit/251f3f8b55a4dc98b831c80e032464ed45cce309/

[RZ/A1H]Add some function(USB 2port, NVIC wrapper) and modify some settings(OS, Terminal).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 46:378357d7e90d 1 /*******************************************************************************
mbed_official 46:378357d7e90d 2 * DISCLAIMER
mbed_official 46:378357d7e90d 3 * This software is supplied by Renesas Electronics Corporation and is only
mbed_official 46:378357d7e90d 4 * intended for use with Renesas products. No other uses are authorized. This
mbed_official 46:378357d7e90d 5 * software is owned by Renesas Electronics Corporation and is protected under
mbed_official 46:378357d7e90d 6 * all applicable laws, including copyright laws.
mbed_official 46:378357d7e90d 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
mbed_official 46:378357d7e90d 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
mbed_official 46:378357d7e90d 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
mbed_official 46:378357d7e90d 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
mbed_official 46:378357d7e90d 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
mbed_official 46:378357d7e90d 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
mbed_official 46:378357d7e90d 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
mbed_official 46:378357d7e90d 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
mbed_official 46:378357d7e90d 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mbed_official 46:378357d7e90d 16 * Renesas reserves the right, without notice, to make changes to this software
mbed_official 46:378357d7e90d 17 * and to discontinue the availability of this software. By using this software,
mbed_official 46:378357d7e90d 18 * you agree to the additional terms and conditions found by accessing the
mbed_official 46:378357d7e90d 19 * following link:
mbed_official 46:378357d7e90d 20 * http://www.renesas.com/disclaimer
mbed_official 46:378357d7e90d 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
mbed_official 46:378357d7e90d 22 *******************************************************************************/
mbed_official 46:378357d7e90d 23 /*******************************************************************************
mbed_official 46:378357d7e90d 24 * File Name : usb1_function_global.c
mbed_official 46:378357d7e90d 25 * $Rev: 1116 $
mbed_official 46:378357d7e90d 26 * $Date:: 2014-07-09 16:29:19 +0900#$
mbed_official 46:378357d7e90d 27 * Device(s) : RZ/A1H
mbed_official 46:378357d7e90d 28 * Tool-Chain :
mbed_official 46:378357d7e90d 29 * OS : None
mbed_official 46:378357d7e90d 30 * H/W Platform :
mbed_official 46:378357d7e90d 31 * Description : RZ/A1H R7S72100 USB Sample Program
mbed_official 46:378357d7e90d 32 * Operation :
mbed_official 46:378357d7e90d 33 * Limitations :
mbed_official 46:378357d7e90d 34 *******************************************************************************/
mbed_official 46:378357d7e90d 35
mbed_official 46:378357d7e90d 36
mbed_official 46:378357d7e90d 37 /*******************************************************************************
mbed_official 46:378357d7e90d 38 Includes <System Includes> , "Project Includes"
mbed_official 46:378357d7e90d 39 *******************************************************************************/
mbed_official 46:378357d7e90d 40 #include "usb1_function.h"
mbed_official 46:378357d7e90d 41
mbed_official 46:378357d7e90d 42
mbed_official 46:378357d7e90d 43 /*******************************************************************************
mbed_official 46:378357d7e90d 44 Typedef definitions
mbed_official 46:378357d7e90d 45 *******************************************************************************/
mbed_official 46:378357d7e90d 46
mbed_official 46:378357d7e90d 47
mbed_official 46:378357d7e90d 48 /*******************************************************************************
mbed_official 46:378357d7e90d 49 Macro definitions
mbed_official 46:378357d7e90d 50 *******************************************************************************/
mbed_official 46:378357d7e90d 51
mbed_official 46:378357d7e90d 52
mbed_official 46:378357d7e90d 53 /*******************************************************************************
mbed_official 46:378357d7e90d 54 Imported global variables and functions (from other files)
mbed_official 46:378357d7e90d 55 *******************************************************************************/
mbed_official 46:378357d7e90d 56
mbed_official 46:378357d7e90d 57
mbed_official 46:378357d7e90d 58 /*******************************************************************************
mbed_official 46:378357d7e90d 59 Exported global variables and functions (to be accessed by other files)
mbed_official 46:378357d7e90d 60 *******************************************************************************/
mbed_official 46:378357d7e90d 61
mbed_official 46:378357d7e90d 62
mbed_official 46:378357d7e90d 63 /*******************************************************************************
mbed_official 46:378357d7e90d 64 Private global variables and functions
mbed_official 46:378357d7e90d 65 *******************************************************************************/
mbed_official 46:378357d7e90d 66 const uint16_t g_usb1_function_bit_set[16] =
mbed_official 46:378357d7e90d 67 {
mbed_official 46:378357d7e90d 68 0x0001, 0x0002, 0x0004, 0x0008,
mbed_official 46:378357d7e90d 69 0x0010, 0x0020, 0x0040, 0x0080,
mbed_official 46:378357d7e90d 70 0x0100, 0x0200, 0x0400, 0x0800,
mbed_official 46:378357d7e90d 71 0x1000, 0x2000, 0x4000, 0x8000
mbed_official 46:378357d7e90d 72 };
mbed_official 46:378357d7e90d 73
mbed_official 46:378357d7e90d 74 uint32_t g_usb1_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 75 uint8_t * g_usb1_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 76
mbed_official 46:378357d7e90d 77 uint16_t g_usb1_function_PipeIgnore[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 78 uint16_t g_usb1_function_PipeTbl[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 79 uint16_t g_usb1_function_pipe_status[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 80 uint32_t g_usb1_function_PipeDataSize[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 81
mbed_official 46:378357d7e90d 82 USB_FUNCTION_DMA_t g_usb1_function_DmaInfo[2];
mbed_official 46:378357d7e90d 83 uint16_t g_usb1_function_DmaPipe[2];
mbed_official 46:378357d7e90d 84 uint16_t g_usb1_function_DmaBval[2];
mbed_official 46:378357d7e90d 85 uint16_t g_usb1_function_DmaStatus[2];
mbed_official 46:378357d7e90d 86
mbed_official 46:378357d7e90d 87 uint16_t g_usb1_function_CtrZeroLengthFlag;
mbed_official 46:378357d7e90d 88
mbed_official 46:378357d7e90d 89 //uint16_t g_usb1_function_ConfigNum;
mbed_official 46:378357d7e90d 90 //uint16_t g_usb1_function_Alternate[USB_FUNCTION_ALT_NO];
mbed_official 46:378357d7e90d 91 //uint16_t g_usb1_function_RemoteWakeupFlag;
mbed_official 46:378357d7e90d 92 uint16_t g_usb1_function_TestModeFlag;
mbed_official 46:378357d7e90d 93 uint16_t g_usb1_function_TestModeSelectors;
mbed_official 46:378357d7e90d 94
mbed_official 46:378357d7e90d 95 //uint16_t g_usb1_function_ReqType;
mbed_official 46:378357d7e90d 96 //uint16_t g_usb1_function_ReqTypeType;
mbed_official 46:378357d7e90d 97 //uint16_t g_usb1_function_ReqTypeRecip;
mbed_official 46:378357d7e90d 98 //uint16_t g_usb1_function_ReqRequest;
mbed_official 46:378357d7e90d 99 //uint16_t g_usb1_function_ReqValue;
mbed_official 46:378357d7e90d 100 //uint16_t g_usb1_function_ReqIndex;
mbed_official 46:378357d7e90d 101 //uint16_t g_usb1_function_ReqLength;
mbed_official 46:378357d7e90d 102
mbed_official 46:378357d7e90d 103 //uint16_t g_usb1_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];
mbed_official 46:378357d7e90d 104
mbed_official 46:378357d7e90d 105 uint16_t g_usb1_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 106 uint16_t g_usb1_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 107 uint16_t g_usb1_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 108 uint16_t g_usb1_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1];
mbed_official 46:378357d7e90d 109
mbed_official 46:378357d7e90d 110
mbed_official 46:378357d7e90d 111 /*******************************************************************************
mbed_official 46:378357d7e90d 112 * Function Name: usb1_function_init_status
mbed_official 46:378357d7e90d 113 * Description : Initialization USB Sample Driver Variable.
mbed_official 46:378357d7e90d 114 * Arguments : none
mbed_official 46:378357d7e90d 115 * Return Value : none
mbed_official 46:378357d7e90d 116 *******************************************************************************/
mbed_official 46:378357d7e90d 117 void usb1_function_init_status (void)
mbed_official 46:378357d7e90d 118 {
mbed_official 46:378357d7e90d 119 uint16_t pipe;
mbed_official 46:378357d7e90d 120
mbed_official 46:378357d7e90d 121 //g_usb1_function_ConfigNum = 0;
mbed_official 46:378357d7e90d 122 //g_usb1_function_RemoteWakeupFlag = DEVDRV_USBF_OFF;
mbed_official 46:378357d7e90d 123 g_usb1_function_TestModeFlag = DEVDRV_USBF_OFF;
mbed_official 46:378357d7e90d 124 g_usb1_function_CtrZeroLengthFlag = 0;
mbed_official 46:378357d7e90d 125
mbed_official 46:378357d7e90d 126 #if 0
mbed_official 46:378357d7e90d 127 usb1_function_clear_alt();
mbed_official 46:378357d7e90d 128 #endif
mbed_official 46:378357d7e90d 129
mbed_official 46:378357d7e90d 130 for (pipe = 0; pipe < (USB_FUNCTION_MAX_PIPE_NO + 1); ++pipe)
mbed_official 46:378357d7e90d 131 {
mbed_official 46:378357d7e90d 132 g_usb1_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
mbed_official 46:378357d7e90d 133 g_usb1_function_PipeDataSize[pipe] = 0;
mbed_official 46:378357d7e90d 134 g_usb1_function_data_count[pipe] = 0;
mbed_official 46:378357d7e90d 135
mbed_official 46:378357d7e90d 136 /* pipe configuration in usb1_function_ResetEP() */
mbed_official 46:378357d7e90d 137 g_usb1_function_pipecfg[pipe] = 0;
mbed_official 46:378357d7e90d 138 g_usb1_function_pipebuf[pipe] = 0;
mbed_official 46:378357d7e90d 139 g_usb1_function_pipemaxp[pipe] = 0;
mbed_official 46:378357d7e90d 140 g_usb1_function_pipeperi[pipe] = 0;
mbed_official 46:378357d7e90d 141 }
mbed_official 46:378357d7e90d 142 }
mbed_official 46:378357d7e90d 143
mbed_official 46:378357d7e90d 144 /* End of File */