Skip to content

Commit

Permalink
Merge pull request #1 from mbedmicro/master
Browse files Browse the repository at this point in the history
Update to latest mbed code
  • Loading branch information
mmahadevan108 committed Apr 29, 2016
2 parents 7f693b7 + d1dc989 commit cb20335
Show file tree
Hide file tree
Showing 1,095 changed files with 180,878 additions and 133,182 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : usb_function.h
* $Rev: 1116 $
* $Date:: 2014-07-09 16:29:19 +0900#$
* Description : RZ/A1H R7S72100 USB Sample Program
*******************************************************************************/
#ifndef USB_FUNCTION_H
#define USB_FUNCTION_H

/*******************************************************************************
Includes <System Includes> , "Project Includes"
*******************************************************************************/
#include "r_typedefs.h"
#include "iodefine.h"
#include "rza_io_regrw.h"

/*******************************************************************************
Macro definitions
*******************************************************************************/
#define USB_FUNCTION_ALT_NO (255)
#define USB_FUNCTION_ALT_SET (0xff)

#define USB_FUNCTION_BITUPLLE (0x0002u)
#define USB_FUNCTION_BITUCKSEL (0x0004u)
#define USB_FUNCTION_BITBWAIT (0x003fu)

#define USB_FUNCTION_BUSWAIT_02 (0x0000u)
#define USB_FUNCTION_BUSWAIT_03 (0x0001u)
#define USB_FUNCTION_BUSWAIT_04 (0x0002u)
#define USB_FUNCTION_BUSWAIT_05 (0x0003u)
#define USB_FUNCTION_BUSWAIT_06 (0x0004u)
#define USB_FUNCTION_BUSWAIT_07 (0x0005u)
#define USB_FUNCTION_BUSWAIT_08 (0x0006u)
#define USB_FUNCTION_BUSWAIT_09 (0x0007u)
#define USB_FUNCTION_BUSWAIT_10 (0x0008u)
#define USB_FUNCTION_BUSWAIT_11 (0x0009u)
#define USB_FUNCTION_BUSWAIT_12 (0x000au)
#define USB_FUNCTION_BUSWAIT_13 (0x000bu)
#define USB_FUNCTION_BUSWAIT_14 (0x000cu)
#define USB_FUNCTION_BUSWAIT_15 (0x000du)
#define USB_FUNCTION_BUSWAIT_16 (0x000eu)
#define USB_FUNCTION_BUSWAIT_17 (0x000fu)

#define USB_FUNCTION_BITRESUME (0x0020u)
#define USB_FUNCTION_BITUACT (0x0010u)
#define USB_FUNCTION_HSPROC (0x0004u)
#define USB_FUNCTION_HSMODE (0x0003u)
#define USB_FUNCTION_FSMODE (0x0002u)
#define USB_FUNCTION_LSMODE (0x0001u)
#define USB_FUNCTION_UNDECID (0x0000u)

#define USB_FUNCTION_BITRCNT (0x8000u)
#define USB_FUNCTION_BITDREQE (0x1000u)
#define USB_FUNCTION_BITMBW (0x0c00u)
#define USB_FUNCTION_BITMBW_8 (0x0000u)
#define USB_FUNCTION_BITMBW_16 (0x0400u)
#define USB_FUNCTION_BITMBW_32 (0x0800u)
#define USB_FUNCTION_BITBYTE_LITTLE (0x0000u)
#define USB_FUNCTION_BITBYTE_BIG (0x0100u)
#define USB_FUNCTION_BITISEL (0x0020u)
#define USB_FUNCTION_BITCURPIPE (0x000fu)

#define USB_FUNCTION_CFIFO_READ (0x0000u)
#define USB_FUNCTION_CFIFO_WRITE (0x0020u)

#define USB_FUNCTION_BITBVAL (0x8000u)
#define USB_FUNCTION_BITBCLR (0x4000u)
#define USB_FUNCTION_BITFRDY (0x2000u)
#define USB_FUNCTION_BITDTLN (0x0fffu)

#define USB_FUNCTION_BITVBSE (0x8000u)
#define USB_FUNCTION_BITRSME (0x4000u)
#define USB_FUNCTION_BITSOFE (0x2000u)
#define USB_FUNCTION_BITDVSE (0x1000u)
#define USB_FUNCTION_BITCTRE (0x0800u)
#define USB_FUNCTION_BITVBINT (0x8000u)
#define USB_FUNCTION_BITRESM (0x4000u)
#define USB_FUNCTION_BITSOFR (0x2000u)
#define USB_FUNCTION_BITDVST (0x1000u)
#define USB_FUNCTION_BITCTRT (0x0800u)

#define USB_FUNCTION_BITBEMPE (0x0400u)
#define USB_FUNCTION_BITNRDYE (0x0200u)
#define USB_FUNCTION_BITBRDYE (0x0100u)
#define USB_FUNCTION_BITBEMP (0x0400u)
#define USB_FUNCTION_BITNRDY (0x0200u)
#define USB_FUNCTION_BITBRDY (0x0100u)

#define USB_FUNCTION_BITDVSQ (0x0070u)
#define USB_FUNCTION_BITDVSQS (0x0030u)
#define USB_FUNCTION_DS_SPD_CNFG (0x0070u)
#define USB_FUNCTION_DS_SPD_ADDR (0x0060u)
#define USB_FUNCTION_DS_SPD_DFLT (0x0050u)
#define USB_FUNCTION_DS_SPD_POWR (0x0040u)
#define USB_FUNCTION_DS_CNFG (0x0030u)
#define USB_FUNCTION_DS_ADDS (0x0020u)
#define USB_FUNCTION_DS_DFLT (0x0010u)
#define USB_FUNCTION_DS_POWR (0x0000u)
#define USB_FUNCTION_BITVALID (0x0008u)
#define USB_FUNCTION_BITCTSQ (0x0007u)
#define USB_FUNCTION_CS_SQER (0x0006u)
#define USB_FUNCTION_CS_WRND (0x0005u)
#define USB_FUNCTION_CS_WRSS (0x0004u)
#define USB_FUNCTION_CS_WRDS (0x0003u)
#define USB_FUNCTION_CS_RDSS (0x0002u)
#define USB_FUNCTION_CS_RDDS (0x0001u)
#define USB_FUNCTION_CS_IDST (0x0000u)

#define USB_FUNCTION_PIPExBUF (64u)

#define USB_FUNCTION_D0FIFO (0)
#define USB_FUNCTION_D1FIFO (1)
#define USB_FUNCTION_DMA_READY (0)
#define USB_FUNCTION_DMA_BUSY (1)
#define USB_FUNCTION_DMA_BUSYEND (2)

#define USB_FUNCTION_FIFO_USE (0x7000)

#endif /* USB_FUNCTION_FUNCTION_H */

/* End of File */
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : usb_function_version.h
* $Rev: 1116 $
* $Date:: 2014-07-09 16:29:19 +0900#$
* Description : RZ/A1H R7S72100 USB Sample Program
*******************************************************************************/

#define USB_FUNCTION_LOCAL_Rev "VER080_140709"

/* End of File */
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : usb0_function.h
* $Rev: 1116 $
* $Date:: 2014-07-09 16:29:19 +0900#$
* Description : RZ/A1H R7S72100 USB Sample Program
*******************************************************************************/
#ifndef USB0_FUNCTION_H
#define USB0_FUNCTION_H


/*******************************************************************************
Includes <System Includes> , "Project Includes"
*******************************************************************************/
#include "devdrv_usb_function_api.h"
#include "usb_function.h"


#ifdef __cplusplus
extern "C" {
#endif

/*******************************************************************************
Typedef definitions
*******************************************************************************/


/*******************************************************************************
Macro definitions
*******************************************************************************/


/*******************************************************************************
Imported global variables and functions (from other files)
*******************************************************************************/
extern const uint16_t g_usb0_function_bit_set[];
extern uint32_t g_usb0_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1];
extern uint8_t *g_usb0_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1];

extern uint16_t g_usb0_function_PipeIgnore[];
extern uint16_t g_usb0_function_PipeTbl[];
extern uint16_t g_usb0_function_pipe_status[];
extern uint32_t g_usb0_function_PipeDataSize[];

extern USB_FUNCTION_DMA_t g_usb0_function_DmaInfo[];
extern uint16_t g_usb0_function_DmaPipe[];
extern uint16_t g_usb0_function_DmaBval[];
extern uint16_t g_usb0_function_DmaStatus[];

extern uint16_t g_usb0_function_CtrZeroLengthFlag;

extern uint16_t g_usb0_function_ConfigNum;
extern uint16_t g_usb0_function_Alternate[USB_FUNCTION_ALT_NO];
extern uint16_t g_usb0_function_RemoteWakeupFlag;
extern uint16_t g_usb0_function_TestModeFlag;
extern uint16_t g_usb0_function_TestModeSelectors;

extern uint16_t g_usb0_function_ReqType;
extern uint16_t g_usb0_function_ReqTypeType;
extern uint16_t g_usb0_function_ReqTypeRecip;
extern uint16_t g_usb0_function_ReqRequest;
extern uint16_t g_usb0_function_ReqValue;
extern uint16_t g_usb0_function_ReqIndex;
extern uint16_t g_usb0_function_ReqLength;

extern uint16_t g_usb0_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];

extern uint16_t g_usb0_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1];
extern uint16_t g_usb0_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1];
extern uint16_t g_usb0_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1];
extern uint16_t g_usb0_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1];


/*******************************************************************************
Exported global variables and functions (to be accessed by other files)
*******************************************************************************/
/* ==== common ==== */
void usb0_function_dma_stop_d0(uint16_t pipe, uint32_t remain);
void usb0_function_dma_stop_d1(uint16_t pipe, uint32_t remain);
uint16_t usb0_function_is_hispeed(void);
uint16_t usb0_function_is_hispeed_enable(void);
uint16_t usb0_function_start_send_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
uint16_t usb0_function_write_buffer(uint16_t pipe);
uint16_t usb0_function_write_buffer_c(uint16_t pipe);
uint16_t usb0_function_write_buffer_d0(uint16_t pipe);
uint16_t usb0_function_write_buffer_d1(uint16_t pipe);
void usb0_function_start_receive_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
uint16_t usb0_function_read_buffer(uint16_t pipe);
uint16_t usb0_function_read_buffer_c(uint16_t pipe);
uint16_t usb0_function_read_buffer_d0(uint16_t pipe);
uint16_t usb0_function_read_buffer_d1(uint16_t pipe);
uint16_t usb0_function_change_fifo_port(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
void usb0_function_set_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
void usb0_function_set_curpipe2(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw, uint16_t dfacc);
uint16_t usb0_function_get_mbw(uint32_t trncount, uint32_t dtptr);
uint16_t usb0_function_read_dma(uint16_t pipe);
void usb0_function_brdy_int(uint16_t status, uint16_t int_enb);
void usb0_function_nrdy_int(uint16_t status, uint16_t int_enb);
void usb0_function_bemp_int(uint16_t status, uint16_t int_enb);
void usb0_function_setting_interrupt(uint8_t level);
void usb0_function_reset_module(uint16_t clockmode);
uint16_t usb0_function_get_buf_size(uint16_t pipe);
uint16_t usb0_function_get_mxps(uint16_t pipe);
void usb0_function_clear_brdy_sts(uint16_t pipe);
void usb0_function_clear_bemp_sts(uint16_t pipe);
void usb0_function_clear_nrdy_sts(uint16_t pipe);
void usb0_function_set_pid_buf(uint16_t pipe);
void usb0_function_set_pid_nak(uint16_t pipe);
void usb0_function_set_pid_stall(uint16_t pipe);
void usb0_function_clear_pid_stall(uint16_t pipe);
uint16_t usb0_function_get_pid(uint16_t pipe);
void usb0_function_set_sqclr(uint16_t pipe);
void usb0_function_set_sqset(uint16_t pipe);
void usb0_function_set_csclr(uint16_t pipe);
void usb0_function_aclrm(uint16_t pipe);
void usb0_function_set_aclrm(uint16_t pipe);
void usb0_function_clr_aclrm(uint16_t pipe);
uint16_t usb0_function_get_sqmon(uint16_t pipe);
uint16_t usb0_function_get_inbuf(uint16_t pipe);

/* ==== function ==== */
void usb0_function_init_status(void);
void usb0_function_InitModule(uint16_t mode);
uint16_t usb0_function_CheckVBUStaus(void);
void usb0_function_USB_FUNCTION_Attach(void);
void usb0_function_USB_FUNCTION_Detach(void);
void usb0_function_USB_FUNCTION_BusReset(void);
void usb0_function_USB_FUNCTION_Resume(void);
void usb0_function_USB_FUNCTION_Suspend(void);
void usb0_function_USB_FUNCTION_TestMode(void);
void usb0_function_ResetDCP(void);
void usb0_function_ResetEP(uint16_t num);
uint16_t usb0_function_EpToPipe(uint16_t ep);
void usb0_function_InitEPTable(uint16_t Con_Num, uint16_t Int_Num, uint16_t Alt_Num);
uint16_t usb0_function_GetConfigNum(void);
uint16_t usb0_function_GetAltNum(uint16_t Con_Num, uint16_t Int_Num);
uint16_t usb0_function_CheckRemoteWakeup(void);
void usb0_function_clear_alt(void);
void usb0_function_clear_pipe_tbl(void);
void usb0_function_clear_ep_table_index(void);
uint16_t usb0_function_GetInterfaceNum(uint16_t num);

#ifdef __cplusplus
}
#endif


#endif /* USB0_FUNCTION_H */

/* End of File */
Loading

0 comments on commit cb20335

Please sign in to comment.