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_dmacdrv.h
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 * Description : RZ/A1H R7S72100 USB Sample Program
mbed_official 46:378357d7e90d 28 *******************************************************************************/
mbed_official 46:378357d7e90d 29 #ifndef USB1_FUNCTION_DMACDRV_H
mbed_official 46:378357d7e90d 30 #define USB1_FUNCTION_DMACDRV_H
mbed_official 46:378357d7e90d 31
mbed_official 46:378357d7e90d 32
mbed_official 46:378357d7e90d 33 /*******************************************************************************
mbed_official 46:378357d7e90d 34 Includes <System Includes> , "Project Includes"
mbed_official 46:378357d7e90d 35 *******************************************************************************/
mbed_official 46:378357d7e90d 36
mbed_official 46:378357d7e90d 37
mbed_official 46:378357d7e90d 38 #ifdef __cplusplus
mbed_official 46:378357d7e90d 39 extern "C" {
mbed_official 46:378357d7e90d 40 #endif
mbed_official 46:378357d7e90d 41
mbed_official 46:378357d7e90d 42 /*******************************************************************************
mbed_official 46:378357d7e90d 43 Typedef definitions
mbed_official 46:378357d7e90d 44 *******************************************************************************/
mbed_official 46:378357d7e90d 45 typedef struct dmac_transinfo
mbed_official 46:378357d7e90d 46 {
mbed_official 46:378357d7e90d 47 uint32_t src_addr; /* Transfer source address */
mbed_official 46:378357d7e90d 48 uint32_t dst_addr; /* Transfer destination address */
mbed_official 46:378357d7e90d 49 uint32_t count; /* Transfer byte count */
mbed_official 46:378357d7e90d 50 uint32_t src_size; /* Transfer source data size */
mbed_official 46:378357d7e90d 51 uint32_t dst_size; /* Transfer destination data size */
mbed_official 46:378357d7e90d 52 uint32_t saddr_dir; /* Transfer source address direction */
mbed_official 46:378357d7e90d 53 uint32_t daddr_dir; /* Transfer destination address direction */
mbed_official 46:378357d7e90d 54 } dmac_transinfo_t;
mbed_official 46:378357d7e90d 55
mbed_official 46:378357d7e90d 56
mbed_official 46:378357d7e90d 57 /*******************************************************************************
mbed_official 46:378357d7e90d 58 Macro definitions
mbed_official 46:378357d7e90d 59 *******************************************************************************/
mbed_official 46:378357d7e90d 60 /* ==== Transfer specification of the sample program ==== */
mbed_official 46:378357d7e90d 61 #define DMAC_SAMPLE_SINGLE (0) /* Single transfer */
mbed_official 46:378357d7e90d 62 #define DMAC_SAMPLE_CONTINUATION (1) /* Continuous transfer (use REN bit) */
mbed_official 46:378357d7e90d 63
mbed_official 46:378357d7e90d 64 /* ==== DMA modes ==== */
mbed_official 46:378357d7e90d 65 #define DMAC_MODE_REGISTER (0) /* Register mode */
mbed_official 46:378357d7e90d 66 #define DMAC_MODE_LINK (1) /* Link mode */
mbed_official 46:378357d7e90d 67
mbed_official 46:378357d7e90d 68 /* ==== Transfer requests ==== */
mbed_official 46:378357d7e90d 69 #define DMAC_REQ_MODE_EXT (0) /* External request */
mbed_official 46:378357d7e90d 70 #define DMAC_REQ_MODE_PERI (1) /* On-chip peripheral module request */
mbed_official 46:378357d7e90d 71 #define DMAC_REQ_MODE_SOFT (2) /* Auto-request (request by software) */
mbed_official 46:378357d7e90d 72
mbed_official 46:378357d7e90d 73 /* ==== DMAC transfer sizes ==== */
mbed_official 46:378357d7e90d 74 #define DMAC_TRANS_SIZE_8 (0) /* 8 bits */
mbed_official 46:378357d7e90d 75 #define DMAC_TRANS_SIZE_16 (1) /* 16 bits */
mbed_official 46:378357d7e90d 76 #define DMAC_TRANS_SIZE_32 (2) /* 32 bits */
mbed_official 46:378357d7e90d 77 #define DMAC_TRANS_SIZE_64 (3) /* 64 bits */
mbed_official 46:378357d7e90d 78 #define DMAC_TRANS_SIZE_128 (4) /* 128 bits */
mbed_official 46:378357d7e90d 79 #define DMAC_TRANS_SIZE_256 (5) /* 256 bits */
mbed_official 46:378357d7e90d 80 #define DMAC_TRANS_SIZE_512 (6) /* 512 bits */
mbed_official 46:378357d7e90d 81 #define DMAC_TRANS_SIZE_1024 (7) /* 1024 bits */
mbed_official 46:378357d7e90d 82
mbed_official 46:378357d7e90d 83 /* ==== Address increment for transferring ==== */
mbed_official 46:378357d7e90d 84 #define DMAC_TRANS_ADR_NO_INC (1) /* Not increment */
mbed_official 46:378357d7e90d 85 #define DMAC_TRANS_ADR_INC (0) /* Increment */
mbed_official 46:378357d7e90d 86
mbed_official 46:378357d7e90d 87 /* ==== Method for detecting DMA request ==== */
mbed_official 46:378357d7e90d 88 #define DMAC_REQ_DET_FALL (0) /* Falling edge detection */
mbed_official 46:378357d7e90d 89 #define DMAC_REQ_DET_RISE (1) /* Rising edge detection */
mbed_official 46:378357d7e90d 90 #define DMAC_REQ_DET_LOW (2) /* Low level detection */
mbed_official 46:378357d7e90d 91 #define DMAC_REQ_DET_HIGH (3) /* High level detection */
mbed_official 46:378357d7e90d 92
mbed_official 46:378357d7e90d 93 /* ==== Request Direction ==== */
mbed_official 46:378357d7e90d 94 #define DMAC_REQ_DIR_SRC (0) /* DMAREQ is the source/ DMAACK is active when reading */
mbed_official 46:378357d7e90d 95 #define DMAC_REQ_DIR_DST (1) /* DMAREQ is the destination/ DMAACK is active when writing */
mbed_official 46:378357d7e90d 96
mbed_official 46:378357d7e90d 97 /* ==== Descriptors ==== */
mbed_official 46:378357d7e90d 98 #define DMAC_DESC_HEADER (0) /* Header */
mbed_official 46:378357d7e90d 99 #define DMAC_DESC_SRC_ADDR (1) /* Source Address */
mbed_official 46:378357d7e90d 100 #define DMAC_DESC_DST_ADDR (2) /* Destination Address */
mbed_official 46:378357d7e90d 101 #define DMAC_DESC_COUNT (3) /* Transaction Byte */
mbed_official 46:378357d7e90d 102 #define DMAC_DESC_CHCFG (4) /* Channel Confg */
mbed_official 46:378357d7e90d 103 #define DMAC_DESC_CHITVL (5) /* Channel Interval */
mbed_official 46:378357d7e90d 104 #define DMAC_DESC_CHEXT (6) /* Channel Extension */
mbed_official 46:378357d7e90d 105 #define DMAC_DESC_LINK_ADDR (7) /* Link Address */
mbed_official 46:378357d7e90d 106
mbed_official 46:378357d7e90d 107 /* ==== On-chip peripheral module requests ===== */
mbed_official 46:378357d7e90d 108 typedef enum dmac_request_factor
mbed_official 46:378357d7e90d 109 {
mbed_official 46:378357d7e90d 110 DMAC_REQ_USB0_DMA0_TX, /* USB_0 channel 0 transmit FIFO empty */
mbed_official 46:378357d7e90d 111 DMAC_REQ_USB0_DMA0_RX, /* USB_0 channel 0 receive FIFO full */
mbed_official 46:378357d7e90d 112 DMAC_REQ_USB0_DMA1_TX, /* USB_0 channel 1 transmit FIFO empty */
mbed_official 46:378357d7e90d 113 DMAC_REQ_USB0_DMA1_RX, /* USB_0 channel 1 receive FIFO full */
mbed_official 46:378357d7e90d 114 DMAC_REQ_USB1_DMA0_TX, /* USB_1 channel 0 transmit FIFO empty */
mbed_official 46:378357d7e90d 115 DMAC_REQ_USB1_DMA0_RX, /* USB_1 channel 0 receive FIFO full */
mbed_official 46:378357d7e90d 116 DMAC_REQ_USB1_DMA1_TX, /* USB_1 channel 1 transmit FIFO empty */
mbed_official 46:378357d7e90d 117 DMAC_REQ_USB1_DMA1_RX, /* USB_1 channel 1 receive FIFO full */
mbed_official 46:378357d7e90d 118 } dmac_request_factor_t;
mbed_official 46:378357d7e90d 119
mbed_official 46:378357d7e90d 120
mbed_official 46:378357d7e90d 121 /*******************************************************************************
mbed_official 46:378357d7e90d 122 Exported global variables and functions (to be accessed by other files)
mbed_official 46:378357d7e90d 123 *******************************************************************************/
mbed_official 46:378357d7e90d 124 void usb1_function_DMAC3_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
mbed_official 46:378357d7e90d 125 uint32_t request_factor, uint32_t req_direction);
mbed_official 46:378357d7e90d 126 int32_t usb1_function_DMAC3_Open(uint32_t req);
mbed_official 46:378357d7e90d 127 void usb1_function_DMAC3_Close(uint32_t *remain);
mbed_official 46:378357d7e90d 128 void usb1_function_DMAC3_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
mbed_official 46:378357d7e90d 129
mbed_official 46:378357d7e90d 130 void usb1_function_DMAC4_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
mbed_official 46:378357d7e90d 131 uint32_t request_factor, uint32_t req_direction);
mbed_official 46:378357d7e90d 132 int32_t usb1_function_DMAC4_Open(uint32_t req);
mbed_official 46:378357d7e90d 133 void usb1_function_DMAC4_Close(uint32_t *remain);
mbed_official 46:378357d7e90d 134 void usb1_function_DMAC4_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
mbed_official 46:378357d7e90d 135
mbed_official 46:378357d7e90d 136 #ifdef __cplusplus
mbed_official 46:378357d7e90d 137 }
mbed_official 46:378357d7e90d 138 #endif
mbed_official 46:378357d7e90d 139
mbed_official 46:378357d7e90d 140 #endif /* USB1_FUNCTION_DMACDRV_H */
mbed_official 46:378357d7e90d 141
mbed_official 46:378357d7e90d 142 /* End of File */