Skip to content

Commit 670e7bc

Browse files
committed
Merge pull request #1639 from mbedNoobNinja/master
New mbed platform VK_RZ_A1H
2 parents d224239 + fa0bf58 commit 670e7bc

File tree

189 files changed

+96465
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+96465
-25
lines changed

libraries/USBDevice/USBDevice/TARGET_RENESAS/TARGET_VK_RZ_A1H/inc/devdrv_usb_function_api.h

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*******************************************************************************
2+
* DISCLAIMER
3+
* This software is supplied by Renesas Electronics Corporation and is only
4+
* intended for use with Renesas products. No other uses are authorized. This
5+
* software is owned by Renesas Electronics Corporation and is protected under
6+
* all applicable laws, including copyright laws.
7+
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
8+
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
9+
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
10+
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
11+
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
12+
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
13+
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
14+
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
15+
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
16+
* Renesas reserves the right, without notice, to make changes to this software
17+
* and to discontinue the availability of this software. By using this software,
18+
* you agree to the additional terms and conditions found by accessing the
19+
* following link:
20+
* http://www.renesas.com/disclaimer
21+
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
22+
*******************************************************************************/
23+
/*******************************************************************************
24+
* File Name : usb_function.h
25+
* $Rev: 1116 $
26+
* $Date:: 2014-07-09 16:29:19 +0900#$
27+
* Description : RZ/A1H R7S72100 USB Sample Program
28+
*******************************************************************************/
29+
#ifndef USB_FUNCTION_H
30+
#define USB_FUNCTION_H
31+
32+
/*******************************************************************************
33+
Includes <System Includes> , "Project Includes"
34+
*******************************************************************************/
35+
#include "r_typedefs.h"
36+
#include "iodefine.h"
37+
#include "rza_io_regrw.h"
38+
39+
/*******************************************************************************
40+
Macro definitions
41+
*******************************************************************************/
42+
#define USB_FUNCTION_ALT_NO (255)
43+
#define USB_FUNCTION_ALT_SET (0xff)
44+
45+
#define USB_FUNCTION_BITUPLLE (0x0002u)
46+
#define USB_FUNCTION_BITUCKSEL (0x0004u)
47+
#define USB_FUNCTION_BITBWAIT (0x003fu)
48+
49+
#define USB_FUNCTION_BUSWAIT_02 (0x0000u)
50+
#define USB_FUNCTION_BUSWAIT_03 (0x0001u)
51+
#define USB_FUNCTION_BUSWAIT_04 (0x0002u)
52+
#define USB_FUNCTION_BUSWAIT_05 (0x0003u)
53+
#define USB_FUNCTION_BUSWAIT_06 (0x0004u)
54+
#define USB_FUNCTION_BUSWAIT_07 (0x0005u)
55+
#define USB_FUNCTION_BUSWAIT_08 (0x0006u)
56+
#define USB_FUNCTION_BUSWAIT_09 (0x0007u)
57+
#define USB_FUNCTION_BUSWAIT_10 (0x0008u)
58+
#define USB_FUNCTION_BUSWAIT_11 (0x0009u)
59+
#define USB_FUNCTION_BUSWAIT_12 (0x000au)
60+
#define USB_FUNCTION_BUSWAIT_13 (0x000bu)
61+
#define USB_FUNCTION_BUSWAIT_14 (0x000cu)
62+
#define USB_FUNCTION_BUSWAIT_15 (0x000du)
63+
#define USB_FUNCTION_BUSWAIT_16 (0x000eu)
64+
#define USB_FUNCTION_BUSWAIT_17 (0x000fu)
65+
66+
#define USB_FUNCTION_BITRESUME (0x0020u)
67+
#define USB_FUNCTION_BITUACT (0x0010u)
68+
#define USB_FUNCTION_HSPROC (0x0004u)
69+
#define USB_FUNCTION_HSMODE (0x0003u)
70+
#define USB_FUNCTION_FSMODE (0x0002u)
71+
#define USB_FUNCTION_LSMODE (0x0001u)
72+
#define USB_FUNCTION_UNDECID (0x0000u)
73+
74+
#define USB_FUNCTION_BITRCNT (0x8000u)
75+
#define USB_FUNCTION_BITDREQE (0x1000u)
76+
#define USB_FUNCTION_BITMBW (0x0c00u)
77+
#define USB_FUNCTION_BITMBW_8 (0x0000u)
78+
#define USB_FUNCTION_BITMBW_16 (0x0400u)
79+
#define USB_FUNCTION_BITMBW_32 (0x0800u)
80+
#define USB_FUNCTION_BITBYTE_LITTLE (0x0000u)
81+
#define USB_FUNCTION_BITBYTE_BIG (0x0100u)
82+
#define USB_FUNCTION_BITISEL (0x0020u)
83+
#define USB_FUNCTION_BITCURPIPE (0x000fu)
84+
85+
#define USB_FUNCTION_CFIFO_READ (0x0000u)
86+
#define USB_FUNCTION_CFIFO_WRITE (0x0020u)
87+
88+
#define USB_FUNCTION_BITBVAL (0x8000u)
89+
#define USB_FUNCTION_BITBCLR (0x4000u)
90+
#define USB_FUNCTION_BITFRDY (0x2000u)
91+
#define USB_FUNCTION_BITDTLN (0x0fffu)
92+
93+
#define USB_FUNCTION_BITVBSE (0x8000u)
94+
#define USB_FUNCTION_BITRSME (0x4000u)
95+
#define USB_FUNCTION_BITSOFE (0x2000u)
96+
#define USB_FUNCTION_BITDVSE (0x1000u)
97+
#define USB_FUNCTION_BITCTRE (0x0800u)
98+
#define USB_FUNCTION_BITVBINT (0x8000u)
99+
#define USB_FUNCTION_BITRESM (0x4000u)
100+
#define USB_FUNCTION_BITSOFR (0x2000u)
101+
#define USB_FUNCTION_BITDVST (0x1000u)
102+
#define USB_FUNCTION_BITCTRT (0x0800u)
103+
104+
#define USB_FUNCTION_BITBEMPE (0x0400u)
105+
#define USB_FUNCTION_BITNRDYE (0x0200u)
106+
#define USB_FUNCTION_BITBRDYE (0x0100u)
107+
#define USB_FUNCTION_BITBEMP (0x0400u)
108+
#define USB_FUNCTION_BITNRDY (0x0200u)
109+
#define USB_FUNCTION_BITBRDY (0x0100u)
110+
111+
#define USB_FUNCTION_BITDVSQ (0x0070u)
112+
#define USB_FUNCTION_BITDVSQS (0x0030u)
113+
#define USB_FUNCTION_DS_SPD_CNFG (0x0070u)
114+
#define USB_FUNCTION_DS_SPD_ADDR (0x0060u)
115+
#define USB_FUNCTION_DS_SPD_DFLT (0x0050u)
116+
#define USB_FUNCTION_DS_SPD_POWR (0x0040u)
117+
#define USB_FUNCTION_DS_CNFG (0x0030u)
118+
#define USB_FUNCTION_DS_ADDS (0x0020u)
119+
#define USB_FUNCTION_DS_DFLT (0x0010u)
120+
#define USB_FUNCTION_DS_POWR (0x0000u)
121+
#define USB_FUNCTION_BITVALID (0x0008u)
122+
#define USB_FUNCTION_BITCTSQ (0x0007u)
123+
#define USB_FUNCTION_CS_SQER (0x0006u)
124+
#define USB_FUNCTION_CS_WRND (0x0005u)
125+
#define USB_FUNCTION_CS_WRSS (0x0004u)
126+
#define USB_FUNCTION_CS_WRDS (0x0003u)
127+
#define USB_FUNCTION_CS_RDSS (0x0002u)
128+
#define USB_FUNCTION_CS_RDDS (0x0001u)
129+
#define USB_FUNCTION_CS_IDST (0x0000u)
130+
131+
#define USB_FUNCTION_PIPExBUF (64u)
132+
133+
#define USB_FUNCTION_D0FIFO (0)
134+
#define USB_FUNCTION_D1FIFO (1)
135+
#define USB_FUNCTION_DMA_READY (0)
136+
#define USB_FUNCTION_DMA_BUSY (1)
137+
#define USB_FUNCTION_DMA_BUSYEND (2)
138+
139+
#define USB_FUNCTION_FIFO_USE (0x7000)
140+
141+
#endif /* USB_FUNCTION_FUNCTION_H */
142+
143+
/* End of File */
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* DISCLAIMER
3+
* This software is supplied by Renesas Electronics Corporation and is only
4+
* intended for use with Renesas products. No other uses are authorized. This
5+
* software is owned by Renesas Electronics Corporation and is protected under
6+
* all applicable laws, including copyright laws.
7+
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
8+
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
9+
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
10+
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
11+
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
12+
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
13+
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
14+
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
15+
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
16+
* Renesas reserves the right, without notice, to make changes to this software
17+
* and to discontinue the availability of this software. By using this software,
18+
* you agree to the additional terms and conditions found by accessing the
19+
* following link:
20+
* http://www.renesas.com/disclaimer
21+
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
22+
*******************************************************************************/
23+
/*******************************************************************************
24+
* File Name : usb_function_version.h
25+
* $Rev: 1116 $
26+
* $Date:: 2014-07-09 16:29:19 +0900#$
27+
* Description : RZ/A1H R7S72100 USB Sample Program
28+
*******************************************************************************/
29+
30+
#define USB_FUNCTION_LOCAL_Rev "VER080_140709"
31+
32+
/* End of File */
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/*******************************************************************************
2+
* DISCLAIMER
3+
* This software is supplied by Renesas Electronics Corporation and is only
4+
* intended for use with Renesas products. No other uses are authorized. This
5+
* software is owned by Renesas Electronics Corporation and is protected under
6+
* all applicable laws, including copyright laws.
7+
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
8+
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
9+
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
10+
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
11+
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
12+
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
13+
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
14+
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
15+
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
16+
* Renesas reserves the right, without notice, to make changes to this software
17+
* and to discontinue the availability of this software. By using this software,
18+
* you agree to the additional terms and conditions found by accessing the
19+
* following link:
20+
* http://www.renesas.com/disclaimer
21+
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
22+
*******************************************************************************/
23+
/*******************************************************************************
24+
* File Name : usb0_function.h
25+
* $Rev: 1116 $
26+
* $Date:: 2014-07-09 16:29:19 +0900#$
27+
* Description : RZ/A1H R7S72100 USB Sample Program
28+
*******************************************************************************/
29+
#ifndef USB0_FUNCTION_H
30+
#define USB0_FUNCTION_H
31+
32+
33+
/*******************************************************************************
34+
Includes <System Includes> , "Project Includes"
35+
*******************************************************************************/
36+
#include "devdrv_usb_function_api.h"
37+
#include "usb_function.h"
38+
39+
40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif
43+
44+
/*******************************************************************************
45+
Typedef definitions
46+
*******************************************************************************/
47+
48+
49+
/*******************************************************************************
50+
Macro definitions
51+
*******************************************************************************/
52+
53+
54+
/*******************************************************************************
55+
Imported global variables and functions (from other files)
56+
*******************************************************************************/
57+
extern const uint16_t g_usb0_function_bit_set[];
58+
extern uint32_t g_usb0_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1];
59+
extern uint8_t *g_usb0_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1];
60+
61+
extern uint16_t g_usb0_function_PipeIgnore[];
62+
extern uint16_t g_usb0_function_PipeTbl[];
63+
extern uint16_t g_usb0_function_pipe_status[];
64+
extern uint32_t g_usb0_function_PipeDataSize[];
65+
66+
extern USB_FUNCTION_DMA_t g_usb0_function_DmaInfo[];
67+
extern uint16_t g_usb0_function_DmaPipe[];
68+
extern uint16_t g_usb0_function_DmaBval[];
69+
extern uint16_t g_usb0_function_DmaStatus[];
70+
71+
extern uint16_t g_usb0_function_CtrZeroLengthFlag;
72+
73+
extern uint16_t g_usb0_function_ConfigNum;
74+
extern uint16_t g_usb0_function_Alternate[USB_FUNCTION_ALT_NO];
75+
extern uint16_t g_usb0_function_RemoteWakeupFlag;
76+
extern uint16_t g_usb0_function_TestModeFlag;
77+
extern uint16_t g_usb0_function_TestModeSelectors;
78+
79+
extern uint16_t g_usb0_function_ReqType;
80+
extern uint16_t g_usb0_function_ReqTypeType;
81+
extern uint16_t g_usb0_function_ReqTypeRecip;
82+
extern uint16_t g_usb0_function_ReqRequest;
83+
extern uint16_t g_usb0_function_ReqValue;
84+
extern uint16_t g_usb0_function_ReqIndex;
85+
extern uint16_t g_usb0_function_ReqLength;
86+
87+
extern uint16_t g_usb0_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];
88+
89+
extern uint16_t g_usb0_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1];
90+
extern uint16_t g_usb0_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1];
91+
extern uint16_t g_usb0_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1];
92+
extern uint16_t g_usb0_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1];
93+
94+
95+
/*******************************************************************************
96+
Exported global variables and functions (to be accessed by other files)
97+
*******************************************************************************/
98+
/* ==== common ==== */
99+
void usb0_function_dma_stop_d0(uint16_t pipe, uint32_t remain);
100+
void usb0_function_dma_stop_d1(uint16_t pipe, uint32_t remain);
101+
uint16_t usb0_function_is_hispeed(void);
102+
uint16_t usb0_function_is_hispeed_enable(void);
103+
uint16_t usb0_function_start_send_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
104+
uint16_t usb0_function_write_buffer(uint16_t pipe);
105+
uint16_t usb0_function_write_buffer_c(uint16_t pipe);
106+
uint16_t usb0_function_write_buffer_d0(uint16_t pipe);
107+
uint16_t usb0_function_write_buffer_d1(uint16_t pipe);
108+
void usb0_function_start_receive_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
109+
uint16_t usb0_function_read_buffer(uint16_t pipe);
110+
uint16_t usb0_function_read_buffer_c(uint16_t pipe);
111+
uint16_t usb0_function_read_buffer_d0(uint16_t pipe);
112+
uint16_t usb0_function_read_buffer_d1(uint16_t pipe);
113+
uint16_t usb0_function_change_fifo_port(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
114+
void usb0_function_set_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
115+
void usb0_function_set_curpipe2(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw, uint16_t dfacc);
116+
uint16_t usb0_function_get_mbw(uint32_t trncount, uint32_t dtptr);
117+
uint16_t usb0_function_read_dma(uint16_t pipe);
118+
void usb0_function_brdy_int(uint16_t status, uint16_t int_enb);
119+
void usb0_function_nrdy_int(uint16_t status, uint16_t int_enb);
120+
void usb0_function_bemp_int(uint16_t status, uint16_t int_enb);
121+
void usb0_function_setting_interrupt(uint8_t level);
122+
void usb0_function_reset_module(uint16_t clockmode);
123+
uint16_t usb0_function_get_buf_size(uint16_t pipe);
124+
uint16_t usb0_function_get_mxps(uint16_t pipe);
125+
void usb0_function_clear_brdy_sts(uint16_t pipe);
126+
void usb0_function_clear_bemp_sts(uint16_t pipe);
127+
void usb0_function_clear_nrdy_sts(uint16_t pipe);
128+
void usb0_function_set_pid_buf(uint16_t pipe);
129+
void usb0_function_set_pid_nak(uint16_t pipe);
130+
void usb0_function_set_pid_stall(uint16_t pipe);
131+
void usb0_function_clear_pid_stall(uint16_t pipe);
132+
uint16_t usb0_function_get_pid(uint16_t pipe);
133+
void usb0_function_set_sqclr(uint16_t pipe);
134+
void usb0_function_set_sqset(uint16_t pipe);
135+
void usb0_function_set_csclr(uint16_t pipe);
136+
void usb0_function_aclrm(uint16_t pipe);
137+
void usb0_function_set_aclrm(uint16_t pipe);
138+
void usb0_function_clr_aclrm(uint16_t pipe);
139+
uint16_t usb0_function_get_sqmon(uint16_t pipe);
140+
uint16_t usb0_function_get_inbuf(uint16_t pipe);
141+
142+
/* ==== function ==== */
143+
void usb0_function_init_status(void);
144+
void usb0_function_InitModule(uint16_t mode);
145+
uint16_t usb0_function_CheckVBUStaus(void);
146+
void usb0_function_USB_FUNCTION_Attach(void);
147+
void usb0_function_USB_FUNCTION_Detach(void);
148+
void usb0_function_USB_FUNCTION_BusReset(void);
149+
void usb0_function_USB_FUNCTION_Resume(void);
150+
void usb0_function_USB_FUNCTION_Suspend(void);
151+
void usb0_function_USB_FUNCTION_TestMode(void);
152+
void usb0_function_ResetDCP(void);
153+
void usb0_function_ResetEP(uint16_t num);
154+
uint16_t usb0_function_EpToPipe(uint16_t ep);
155+
void usb0_function_InitEPTable(uint16_t Con_Num, uint16_t Int_Num, uint16_t Alt_Num);
156+
uint16_t usb0_function_GetConfigNum(void);
157+
uint16_t usb0_function_GetAltNum(uint16_t Con_Num, uint16_t Int_Num);
158+
uint16_t usb0_function_CheckRemoteWakeup(void);
159+
void usb0_function_clear_alt(void);
160+
void usb0_function_clear_pipe_tbl(void);
161+
void usb0_function_clear_ep_table_index(void);
162+
uint16_t usb0_function_GetInterfaceNum(uint16_t num);
163+
164+
#ifdef __cplusplus
165+
}
166+
#endif
167+
168+
169+
#endif /* USB0_FUNCTION_H */
170+
171+
/* End of File */

0 commit comments

Comments
 (0)