1st Release
Fork of USBDevice by
USBDevice/TARGET_RENESAS/TARGET_RZ_A1H/usb1/inc/usb1_function.h@46:378357d7e90d, 2015-03-31 (annotated)
- 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?
User | Revision | Line number | New 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.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_H |
mbed_official | 46:378357d7e90d | 30 | #define USB1_FUNCTION_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 | #include "devdrv_usb_function_api.h" |
mbed_official | 46:378357d7e90d | 37 | #include "usb_function.h" |
mbed_official | 46:378357d7e90d | 38 | |
mbed_official | 46:378357d7e90d | 39 | |
mbed_official | 46:378357d7e90d | 40 | #ifdef __cplusplus |
mbed_official | 46:378357d7e90d | 41 | extern "C" { |
mbed_official | 46:378357d7e90d | 42 | #endif |
mbed_official | 46:378357d7e90d | 43 | |
mbed_official | 46:378357d7e90d | 44 | /******************************************************************************* |
mbed_official | 46:378357d7e90d | 45 | Typedef definitions |
mbed_official | 46:378357d7e90d | 46 | *******************************************************************************/ |
mbed_official | 46:378357d7e90d | 47 | |
mbed_official | 46:378357d7e90d | 48 | |
mbed_official | 46:378357d7e90d | 49 | /******************************************************************************* |
mbed_official | 46:378357d7e90d | 50 | Macro definitions |
mbed_official | 46:378357d7e90d | 51 | *******************************************************************************/ |
mbed_official | 46:378357d7e90d | 52 | |
mbed_official | 46:378357d7e90d | 53 | |
mbed_official | 46:378357d7e90d | 54 | /******************************************************************************* |
mbed_official | 46:378357d7e90d | 55 | Imported global variables and functions (from other files) |
mbed_official | 46:378357d7e90d | 56 | *******************************************************************************/ |
mbed_official | 46:378357d7e90d | 57 | extern const uint16_t g_usb1_function_bit_set[]; |
mbed_official | 46:378357d7e90d | 58 | extern uint32_t g_usb1_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 59 | extern uint8_t *g_usb1_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 60 | |
mbed_official | 46:378357d7e90d | 61 | extern uint16_t g_usb1_function_PipeIgnore[]; |
mbed_official | 46:378357d7e90d | 62 | extern uint16_t g_usb1_function_PipeTbl[]; |
mbed_official | 46:378357d7e90d | 63 | extern uint16_t g_usb1_function_pipe_status[]; |
mbed_official | 46:378357d7e90d | 64 | extern uint32_t g_usb1_function_PipeDataSize[]; |
mbed_official | 46:378357d7e90d | 65 | |
mbed_official | 46:378357d7e90d | 66 | extern USB_FUNCTION_DMA_t g_usb1_function_DmaInfo[]; |
mbed_official | 46:378357d7e90d | 67 | extern uint16_t g_usb1_function_DmaPipe[]; |
mbed_official | 46:378357d7e90d | 68 | extern uint16_t g_usb1_function_DmaBval[]; |
mbed_official | 46:378357d7e90d | 69 | extern uint16_t g_usb1_function_DmaStatus[]; |
mbed_official | 46:378357d7e90d | 70 | |
mbed_official | 46:378357d7e90d | 71 | extern uint16_t g_usb1_function_CtrZeroLengthFlag; |
mbed_official | 46:378357d7e90d | 72 | |
mbed_official | 46:378357d7e90d | 73 | extern uint16_t g_usb1_function_ConfigNum; |
mbed_official | 46:378357d7e90d | 74 | extern uint16_t g_usb1_function_Alternate[USB_FUNCTION_ALT_NO]; |
mbed_official | 46:378357d7e90d | 75 | extern uint16_t g_usb1_function_RemoteWakeupFlag; |
mbed_official | 46:378357d7e90d | 76 | extern uint16_t g_usb1_function_TestModeFlag; |
mbed_official | 46:378357d7e90d | 77 | extern uint16_t g_usb1_function_TestModeSelectors; |
mbed_official | 46:378357d7e90d | 78 | |
mbed_official | 46:378357d7e90d | 79 | extern uint16_t g_usb1_function_ReqType; |
mbed_official | 46:378357d7e90d | 80 | extern uint16_t g_usb1_function_ReqTypeType; |
mbed_official | 46:378357d7e90d | 81 | extern uint16_t g_usb1_function_ReqTypeRecip; |
mbed_official | 46:378357d7e90d | 82 | extern uint16_t g_usb1_function_ReqRequest; |
mbed_official | 46:378357d7e90d | 83 | extern uint16_t g_usb1_function_ReqValue; |
mbed_official | 46:378357d7e90d | 84 | extern uint16_t g_usb1_function_ReqIndex; |
mbed_official | 46:378357d7e90d | 85 | extern uint16_t g_usb1_function_ReqLength; |
mbed_official | 46:378357d7e90d | 86 | |
mbed_official | 46:378357d7e90d | 87 | extern uint16_t g_usb1_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1]; |
mbed_official | 46:378357d7e90d | 88 | |
mbed_official | 46:378357d7e90d | 89 | extern uint16_t g_usb1_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 90 | extern uint16_t g_usb1_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 91 | extern uint16_t g_usb1_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 92 | extern uint16_t g_usb1_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1]; |
mbed_official | 46:378357d7e90d | 93 | |
mbed_official | 46:378357d7e90d | 94 | |
mbed_official | 46:378357d7e90d | 95 | /******************************************************************************* |
mbed_official | 46:378357d7e90d | 96 | Exported global variables and functions (to be accessed by other files) |
mbed_official | 46:378357d7e90d | 97 | *******************************************************************************/ |
mbed_official | 46:378357d7e90d | 98 | /* ==== common ==== */ |
mbed_official | 46:378357d7e90d | 99 | void usb1_function_dma_stop_d0(uint16_t pipe, uint32_t remain); |
mbed_official | 46:378357d7e90d | 100 | void usb1_function_dma_stop_d1(uint16_t pipe, uint32_t remain); |
mbed_official | 46:378357d7e90d | 101 | uint16_t usb1_function_is_hispeed(void); |
mbed_official | 46:378357d7e90d | 102 | uint16_t usb1_function_is_hispeed_enable(void); |
mbed_official | 46:378357d7e90d | 103 | uint16_t usb1_function_start_send_transfer(uint16_t pipe, uint32_t size, uint8_t *data); |
mbed_official | 46:378357d7e90d | 104 | uint16_t usb1_function_write_buffer(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 105 | uint16_t usb1_function_write_buffer_c(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 106 | uint16_t usb1_function_write_buffer_d0(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 107 | uint16_t usb1_function_write_buffer_d1(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 108 | void usb1_function_start_receive_transfer(uint16_t pipe, uint32_t size, uint8_t *data); |
mbed_official | 46:378357d7e90d | 109 | uint16_t usb1_function_read_buffer(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 110 | uint16_t usb1_function_read_buffer_c(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 111 | uint16_t usb1_function_read_buffer_d0(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 112 | uint16_t usb1_function_read_buffer_d1(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 113 | uint16_t usb1_function_change_fifo_port(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw); |
mbed_official | 46:378357d7e90d | 114 | void usb1_function_set_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw); |
mbed_official | 46:378357d7e90d | 115 | void usb1_function_set_curpipe2(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw, uint16_t dfacc); |
mbed_official | 46:378357d7e90d | 116 | uint16_t usb1_function_get_mbw(uint32_t trncount, uint32_t dtptr); |
mbed_official | 46:378357d7e90d | 117 | uint16_t usb1_function_read_dma(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 118 | void usb1_function_brdy_int(uint16_t status, uint16_t int_enb); |
mbed_official | 46:378357d7e90d | 119 | void usb1_function_nrdy_int(uint16_t status, uint16_t int_enb); |
mbed_official | 46:378357d7e90d | 120 | void usb1_function_bemp_int(uint16_t status, uint16_t int_enb); |
mbed_official | 46:378357d7e90d | 121 | void usb1_function_setting_interrupt(uint8_t level); |
mbed_official | 46:378357d7e90d | 122 | void usb1_function_reset_module(uint16_t clockmode); |
mbed_official | 46:378357d7e90d | 123 | uint16_t usb1_function_get_buf_size(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 124 | uint16_t usb1_function_get_mxps(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 125 | void usb1_function_clear_brdy_sts(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 126 | void usb1_function_clear_bemp_sts(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 127 | void usb1_function_clear_nrdy_sts(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 128 | void usb1_function_set_pid_buf(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 129 | void usb1_function_set_pid_nak(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 130 | void usb1_function_set_pid_stall(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 131 | void usb1_function_clear_pid_stall(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 132 | uint16_t usb1_function_get_pid(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 133 | void usb1_function_set_sqclr(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 134 | void usb1_function_set_sqset(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 135 | void usb1_function_set_csclr(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 136 | void usb1_function_aclrm(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 137 | void usb1_function_set_aclrm(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 138 | void usb1_function_clr_aclrm(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 139 | uint16_t usb1_function_get_sqmon(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 140 | uint16_t usb1_function_get_inbuf(uint16_t pipe); |
mbed_official | 46:378357d7e90d | 141 | |
mbed_official | 46:378357d7e90d | 142 | /* ==== function ==== */ |
mbed_official | 46:378357d7e90d | 143 | void usb1_function_init_status(void); |
mbed_official | 46:378357d7e90d | 144 | void usb1_function_InitModule(uint16_t mode); |
mbed_official | 46:378357d7e90d | 145 | uint16_t usb1_function_CheckVBUStaus(void); |
mbed_official | 46:378357d7e90d | 146 | void usb1_function_USB_FUNCTION_Attach(void); |
mbed_official | 46:378357d7e90d | 147 | void usb1_function_USB_FUNCTION_Detach(void); |
mbed_official | 46:378357d7e90d | 148 | void usb1_function_USB_FUNCTION_BusReset(void); |
mbed_official | 46:378357d7e90d | 149 | void usb1_function_USB_FUNCTION_Resume(void); |
mbed_official | 46:378357d7e90d | 150 | void usb1_function_USB_FUNCTION_Suspend(void); |
mbed_official | 46:378357d7e90d | 151 | void usb1_function_USB_FUNCTION_TestMode(void); |
mbed_official | 46:378357d7e90d | 152 | void usb1_function_ResetDCP(void); |
mbed_official | 46:378357d7e90d | 153 | void usb1_function_ResetEP(uint16_t num); |
mbed_official | 46:378357d7e90d | 154 | uint16_t usb1_function_EpToPipe(uint16_t ep); |
mbed_official | 46:378357d7e90d | 155 | void usb1_function_InitEPTable(uint16_t Con_Num, uint16_t Int_Num, uint16_t Alt_Num); |
mbed_official | 46:378357d7e90d | 156 | uint16_t usb1_function_GetConfigNum(void); |
mbed_official | 46:378357d7e90d | 157 | uint16_t usb1_function_GetAltNum(uint16_t Con_Num, uint16_t Int_Num); |
mbed_official | 46:378357d7e90d | 158 | uint16_t usb1_function_CheckRemoteWakeup(void); |
mbed_official | 46:378357d7e90d | 159 | void usb1_function_clear_alt(void); |
mbed_official | 46:378357d7e90d | 160 | void usb1_function_clear_pipe_tbl(void); |
mbed_official | 46:378357d7e90d | 161 | void usb1_function_clear_ep_table_index(void); |
mbed_official | 46:378357d7e90d | 162 | uint16_t usb1_function_GetInterfaceNum(uint16_t num); |
mbed_official | 46:378357d7e90d | 163 | |
mbed_official | 46:378357d7e90d | 164 | #ifdef __cplusplus |
mbed_official | 46:378357d7e90d | 165 | } |
mbed_official | 46:378357d7e90d | 166 | #endif |
mbed_official | 46:378357d7e90d | 167 | |
mbed_official | 46:378357d7e90d | 168 | |
mbed_official | 46:378357d7e90d | 169 | #endif /* USB1_FUNCTION_H */ |
mbed_official | 46:378357d7e90d | 170 | |
mbed_official | 46:378357d7e90d | 171 | /* End of File */ |