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