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
Parent:
USBDevice/TARGET_RENESAS/TARGET_RZ_A1H/inc/usb0_function_dmacdrv.h@35:a8484e16c2f3
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 35:a8484e16c2f3 1 /*******************************************************************************
mbed_official 35:a8484e16c2f3 2 * DISCLAIMER
mbed_official 35:a8484e16c2f3 3 * This software is supplied by Renesas Electronics Corporation and is only
mbed_official 35:a8484e16c2f3 4 * intended for use with Renesas products. No other uses are authorized. This
mbed_official 35:a8484e16c2f3 5 * software is owned by Renesas Electronics Corporation and is protected under
mbed_official 35:a8484e16c2f3 6 * all applicable laws, including copyright laws.
mbed_official 35:a8484e16c2f3 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
mbed_official 35:a8484e16c2f3 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
mbed_official 35:a8484e16c2f3 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
mbed_official 35:a8484e16c2f3 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
mbed_official 35:a8484e16c2f3 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
mbed_official 35:a8484e16c2f3 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
mbed_official 35:a8484e16c2f3 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
mbed_official 35:a8484e16c2f3 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
mbed_official 35:a8484e16c2f3 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mbed_official 35:a8484e16c2f3 16 * Renesas reserves the right, without notice, to make changes to this software
mbed_official 35:a8484e16c2f3 17 * and to discontinue the availability of this software. By using this software,
mbed_official 35:a8484e16c2f3 18 * you agree to the additional terms and conditions found by accessing the
mbed_official 35:a8484e16c2f3 19 * following link:
mbed_official 35:a8484e16c2f3 20 * http://www.renesas.com/disclaimer
mbed_official 35:a8484e16c2f3 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
mbed_official 35:a8484e16c2f3 22 *******************************************************************************/
mbed_official 35:a8484e16c2f3 23 /*******************************************************************************
mbed_official 35:a8484e16c2f3 24 * File Name : usb0_function_dmacdrv.h
mbed_official 35:a8484e16c2f3 25 * $Rev: 1116 $
mbed_official 35:a8484e16c2f3 26 * $Date:: 2014-07-09 16:29:19 +0900#$
mbed_official 35:a8484e16c2f3 27 * Description : RZ/A1H R7S72100 USB Sample Program
mbed_official 35:a8484e16c2f3 28 *******************************************************************************/
mbed_official 35:a8484e16c2f3 29 #ifndef USB0_FUNCTION_DMACDRV_H
mbed_official 35:a8484e16c2f3 30 #define USB0_FUNCTION_DMACDRV_H
mbed_official 35:a8484e16c2f3 31
mbed_official 35:a8484e16c2f3 32
mbed_official 35:a8484e16c2f3 33 /*******************************************************************************
mbed_official 35:a8484e16c2f3 34 Includes <System Includes> , "Project Includes"
mbed_official 35:a8484e16c2f3 35 *******************************************************************************/
mbed_official 35:a8484e16c2f3 36
mbed_official 35:a8484e16c2f3 37
mbed_official 35:a8484e16c2f3 38 #ifdef __cplusplus
mbed_official 35:a8484e16c2f3 39 extern "C" {
mbed_official 35:a8484e16c2f3 40 #endif
mbed_official 35:a8484e16c2f3 41
mbed_official 35:a8484e16c2f3 42 /*******************************************************************************
mbed_official 35:a8484e16c2f3 43 Typedef definitions
mbed_official 35:a8484e16c2f3 44 *******************************************************************************/
mbed_official 35:a8484e16c2f3 45 typedef struct dmac_transinfo
mbed_official 35:a8484e16c2f3 46 {
mbed_official 35:a8484e16c2f3 47 uint32_t src_addr; /* Transfer source address */
mbed_official 35:a8484e16c2f3 48 uint32_t dst_addr; /* Transfer destination address */
mbed_official 35:a8484e16c2f3 49 uint32_t count; /* Transfer byte count */
mbed_official 35:a8484e16c2f3 50 uint32_t src_size; /* Transfer source data size */
mbed_official 35:a8484e16c2f3 51 uint32_t dst_size; /* Transfer destination data size */
mbed_official 35:a8484e16c2f3 52 uint32_t saddr_dir; /* Transfer source address direction */
mbed_official 35:a8484e16c2f3 53 uint32_t daddr_dir; /* Transfer destination address direction */
mbed_official 35:a8484e16c2f3 54 } dmac_transinfo_t;
mbed_official 35:a8484e16c2f3 55
mbed_official 35:a8484e16c2f3 56
mbed_official 35:a8484e16c2f3 57 /*******************************************************************************
mbed_official 35:a8484e16c2f3 58 Macro definitions
mbed_official 35:a8484e16c2f3 59 *******************************************************************************/
mbed_official 35:a8484e16c2f3 60 /* ==== Transfer specification of the sample program ==== */
mbed_official 35:a8484e16c2f3 61 #define DMAC_SAMPLE_SINGLE (0) /* Single transfer */
mbed_official 35:a8484e16c2f3 62 #define DMAC_SAMPLE_CONTINUATION (1) /* Continuous transfer (use REN bit) */
mbed_official 35:a8484e16c2f3 63
mbed_official 35:a8484e16c2f3 64 /* ==== DMA modes ==== */
mbed_official 35:a8484e16c2f3 65 #define DMAC_MODE_REGISTER (0) /* Register mode */
mbed_official 35:a8484e16c2f3 66 #define DMAC_MODE_LINK (1) /* Link mode */
mbed_official 35:a8484e16c2f3 67
mbed_official 35:a8484e16c2f3 68 /* ==== Transfer requests ==== */
mbed_official 35:a8484e16c2f3 69 #define DMAC_REQ_MODE_EXT (0) /* External request */
mbed_official 35:a8484e16c2f3 70 #define DMAC_REQ_MODE_PERI (1) /* On-chip peripheral module request */
mbed_official 35:a8484e16c2f3 71 #define DMAC_REQ_MODE_SOFT (2) /* Auto-request (request by software) */
mbed_official 35:a8484e16c2f3 72
mbed_official 35:a8484e16c2f3 73 /* ==== DMAC transfer sizes ==== */
mbed_official 35:a8484e16c2f3 74 #define DMAC_TRANS_SIZE_8 (0) /* 8 bits */
mbed_official 35:a8484e16c2f3 75 #define DMAC_TRANS_SIZE_16 (1) /* 16 bits */
mbed_official 35:a8484e16c2f3 76 #define DMAC_TRANS_SIZE_32 (2) /* 32 bits */
mbed_official 35:a8484e16c2f3 77 #define DMAC_TRANS_SIZE_64 (3) /* 64 bits */
mbed_official 35:a8484e16c2f3 78 #define DMAC_TRANS_SIZE_128 (4) /* 128 bits */
mbed_official 35:a8484e16c2f3 79 #define DMAC_TRANS_SIZE_256 (5) /* 256 bits */
mbed_official 35:a8484e16c2f3 80 #define DMAC_TRANS_SIZE_512 (6) /* 512 bits */
mbed_official 35:a8484e16c2f3 81 #define DMAC_TRANS_SIZE_1024 (7) /* 1024 bits */
mbed_official 35:a8484e16c2f3 82
mbed_official 35:a8484e16c2f3 83 /* ==== Address increment for transferring ==== */
mbed_official 35:a8484e16c2f3 84 #define DMAC_TRANS_ADR_NO_INC (1) /* Not increment */
mbed_official 35:a8484e16c2f3 85 #define DMAC_TRANS_ADR_INC (0) /* Increment */
mbed_official 35:a8484e16c2f3 86
mbed_official 35:a8484e16c2f3 87 /* ==== Method for detecting DMA request ==== */
mbed_official 35:a8484e16c2f3 88 #define DMAC_REQ_DET_FALL (0) /* Falling edge detection */
mbed_official 35:a8484e16c2f3 89 #define DMAC_REQ_DET_RISE (1) /* Rising edge detection */
mbed_official 35:a8484e16c2f3 90 #define DMAC_REQ_DET_LOW (2) /* Low level detection */
mbed_official 35:a8484e16c2f3 91 #define DMAC_REQ_DET_HIGH (3) /* High level detection */
mbed_official 35:a8484e16c2f3 92
mbed_official 35:a8484e16c2f3 93 /* ==== Request Direction ==== */
mbed_official 35:a8484e16c2f3 94 #define DMAC_REQ_DIR_SRC (0) /* DMAREQ is the source/ DMAACK is active when reading */
mbed_official 35:a8484e16c2f3 95 #define DMAC_REQ_DIR_DST (1) /* DMAREQ is the destination/ DMAACK is active when writing */
mbed_official 35:a8484e16c2f3 96
mbed_official 35:a8484e16c2f3 97 /* ==== Descriptors ==== */
mbed_official 35:a8484e16c2f3 98 #define DMAC_DESC_HEADER (0) /* Header */
mbed_official 35:a8484e16c2f3 99 #define DMAC_DESC_SRC_ADDR (1) /* Source Address */
mbed_official 35:a8484e16c2f3 100 #define DMAC_DESC_DST_ADDR (2) /* Destination Address */
mbed_official 35:a8484e16c2f3 101 #define DMAC_DESC_COUNT (3) /* Transaction Byte */
mbed_official 35:a8484e16c2f3 102 #define DMAC_DESC_CHCFG (4) /* Channel Confg */
mbed_official 35:a8484e16c2f3 103 #define DMAC_DESC_CHITVL (5) /* Channel Interval */
mbed_official 35:a8484e16c2f3 104 #define DMAC_DESC_CHEXT (6) /* Channel Extension */
mbed_official 35:a8484e16c2f3 105 #define DMAC_DESC_LINK_ADDR (7) /* Link Address */
mbed_official 35:a8484e16c2f3 106
mbed_official 35:a8484e16c2f3 107 /* ==== On-chip peripheral module requests ===== */
mbed_official 35:a8484e16c2f3 108 typedef enum dmac_request_factor
mbed_official 35:a8484e16c2f3 109 {
mbed_official 35:a8484e16c2f3 110 DMAC_REQ_USB0_DMA0_TX, /* USB_0 channel 0 transmit FIFO empty */
mbed_official 35:a8484e16c2f3 111 DMAC_REQ_USB0_DMA0_RX, /* USB_0 channel 0 receive FIFO full */
mbed_official 35:a8484e16c2f3 112 DMAC_REQ_USB0_DMA1_TX, /* USB_0 channel 1 transmit FIFO empty */
mbed_official 35:a8484e16c2f3 113 DMAC_REQ_USB0_DMA1_RX, /* USB_0 channel 1 receive FIFO full */
mbed_official 35:a8484e16c2f3 114 DMAC_REQ_USB1_DMA0_TX, /* USB_1 channel 0 transmit FIFO empty */
mbed_official 35:a8484e16c2f3 115 DMAC_REQ_USB1_DMA0_RX, /* USB_1 channel 0 receive FIFO full */
mbed_official 35:a8484e16c2f3 116 DMAC_REQ_USB1_DMA1_TX, /* USB_1 channel 1 transmit FIFO empty */
mbed_official 35:a8484e16c2f3 117 DMAC_REQ_USB1_DMA1_RX, /* USB_1 channel 1 receive FIFO full */
mbed_official 35:a8484e16c2f3 118 } dmac_request_factor_t;
mbed_official 35:a8484e16c2f3 119
mbed_official 35:a8484e16c2f3 120
mbed_official 35:a8484e16c2f3 121 /*******************************************************************************
mbed_official 35:a8484e16c2f3 122 Exported global variables and functions (to be accessed by other files)
mbed_official 35:a8484e16c2f3 123 *******************************************************************************/
mbed_official 35:a8484e16c2f3 124 void usb0_function_DMAC1_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
mbed_official 35:a8484e16c2f3 125 uint32_t request_factor, uint32_t req_direction);
mbed_official 35:a8484e16c2f3 126 int32_t usb0_function_DMAC1_Open(uint32_t req);
mbed_official 35:a8484e16c2f3 127 void usb0_function_DMAC1_Close(uint32_t *remain);
mbed_official 35:a8484e16c2f3 128 void usb0_function_DMAC1_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
mbed_official 35:a8484e16c2f3 129
mbed_official 35:a8484e16c2f3 130 void usb0_function_DMAC2_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
mbed_official 35:a8484e16c2f3 131 uint32_t request_factor, uint32_t req_direction);
mbed_official 35:a8484e16c2f3 132 int32_t usb0_function_DMAC2_Open(uint32_t req);
mbed_official 35:a8484e16c2f3 133 void usb0_function_DMAC2_Close(uint32_t *remain);
mbed_official 35:a8484e16c2f3 134 void usb0_function_DMAC2_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
mbed_official 35:a8484e16c2f3 135
mbed_official 35:a8484e16c2f3 136 #ifdef __cplusplus
mbed_official 35:a8484e16c2f3 137 }
mbed_official 35:a8484e16c2f3 138 #endif
mbed_official 35:a8484e16c2f3 139
mbed_official 35:a8484e16c2f3 140 #endif /* USB0_FUNCTION_DMACDRV_H */
mbed_official 35:a8484e16c2f3 141
mbed_official 35:a8484e16c2f3 142 /* End of File */