forked for unsupported target

Dependents:   stm32-disco-example DISCO-F469NI_BD_SD_Card_Control

Fork of USBHOST by ST

Committer:
frq08711@LMECWL0871.LME.ST.COM
Date:
Wed Feb 15 10:49:44 2017 +0100
Revision:
1:ab240722d7ef
update to mbed 5.3.5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 1 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 2 * DISCLAIMER
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 3 * This software is supplied by Renesas Electronics Corporation and is only
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 4 * intended for use with Renesas products. No other uses are authorized. This
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 5 * software is owned by Renesas Electronics Corporation and is protected under
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 6 * all applicable laws, including copyright laws.
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 16 * Renesas reserves the right, without notice, to make changes to this software
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 17 * and to discontinue the availability of this software. By using this software,
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 18 * you agree to the additional terms and conditions found by accessing the
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 19 * following link:
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 20 * http://www.renesas.com/disclaimer
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 22 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 23 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 24 * File Name : usb0_host.h
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 25 * $Rev: 1116 $
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 26 * $Date:: 2014-07-09 16:29:19 +0900#$
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 27 * Description : RZ/A1H R7S72100 USB Sample Program
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 28 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 29 #ifndef USB0_HOST_H
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 30 #define USB0_HOST_H
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 31
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 32 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 33 Includes <System Includes> , "Project Includes"
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 34 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 35 #include "devdrv_usb_host_api.h"
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 36 #include "usb_host.h"
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 37
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 38 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 39 Imported global variables and functions (from other files)
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 40 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 41 extern const uint16_t g_usb0_host_bit_set[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 42 extern uint32_t g_usb0_host_data_count[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 43 extern uint8_t *g_usb0_host_data_pointer[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 44
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 45 extern uint16_t g_usb0_host_PipeIgnore[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 46 extern uint16_t g_usb0_host_PipeTbl[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 47 extern uint16_t g_usb0_host_pipe_status[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 48 extern uint32_t g_usb0_host_PipeDataSize[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 49
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 50 extern USB_HOST_DMA_t g_usb0_host_DmaInfo[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 51 extern uint16_t g_usb0_host_DmaPipe[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 52 extern uint16_t g_usb0_host_DmaBval[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 53 extern uint16_t g_usb0_host_DmaStatus[];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 54
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 55 extern uint16_t g_usb0_host_driver_state;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 56 extern uint16_t g_usb0_host_ConfigNum;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 57 extern uint16_t g_usb0_host_CmdStage;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 58 extern uint16_t g_usb0_host_bchg_flag;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 59 extern uint16_t g_usb0_host_detach_flag;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 60 extern uint16_t g_usb0_host_attach_flag;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 61
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 62 extern uint16_t g_usb0_host_UsbAddress;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 63 extern uint16_t g_usb0_host_setUsbAddress;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 64 extern uint16_t g_usb0_host_default_max_packet[USB_HOST_MAX_DEVICE + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 65 extern uint16_t g_usb0_host_UsbDeviceSpeed;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 66 extern uint16_t g_usb0_host_SupportUsbDeviceSpeed;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 67
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 68 extern uint16_t g_usb0_host_SavReq;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 69 extern uint16_t g_usb0_host_SavVal;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 70 extern uint16_t g_usb0_host_SavIndx;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 71 extern uint16_t g_usb0_host_SavLen;
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 72
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 73 extern uint16_t g_usb0_host_pipecfg[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 74 extern uint16_t g_usb0_host_pipebuf[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 75 extern uint16_t g_usb0_host_pipemaxp[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 76 extern uint16_t g_usb0_host_pipeperi[USB_HOST_MAX_PIPE_NO + 1];
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 77
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 78 /*******************************************************************************
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 79 Functions Prototypes
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 80 *******************************************************************************/
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 81 /* ==== common ==== */
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 82 void usb0_host_dma_stop_d0(uint16_t pipe, uint32_t remain);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 83 void usb0_host_dma_stop_d1(uint16_t pipe, uint32_t remain);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 84 uint16_t usb0_host_is_hispeed(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 85 uint16_t usb0_host_is_hispeed_enable(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 86 uint16_t usb0_host_start_send_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 87 uint16_t usb0_host_write_buffer(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 88 uint16_t usb0_host_write_buffer_c(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 89 uint16_t usb0_host_write_buffer_d0(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 90 uint16_t usb0_host_write_buffer_d1(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 91 void usb0_host_start_receive_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 92 uint16_t usb0_host_read_buffer(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 93 uint16_t usb0_host_read_buffer_c(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 94 uint16_t usb0_host_read_buffer_d0(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 95 uint16_t usb0_host_read_buffer_d1(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 96 uint16_t usb0_host_change_fifo_port(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 97 void usb0_host_set_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 98 void usb0_host_set_curpipe2(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw, uint16_t dfacc);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 99 uint16_t usb0_host_get_mbw(uint32_t trncount, uint32_t dtptr);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 100 uint16_t usb0_host_read_dma(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 101 void usb0_host_stop_transfer(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 102 void usb0_host_brdy_int(uint16_t status, uint16_t int_enb);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 103 void usb0_host_nrdy_int(uint16_t status, uint16_t int_enb);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 104 void usb0_host_bemp_int(uint16_t status, uint16_t int_enb);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 105 void usb0_host_setting_interrupt(uint8_t level);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 106 void usb0_host_reset_module(uint16_t clockmode);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 107 uint16_t usb0_host_get_buf_size(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 108 uint16_t usb0_host_get_mxps(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 109 void usb0_host_enable_brdy_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 110 void usb0_host_disable_brdy_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 111 void usb0_host_clear_brdy_sts(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 112 void usb0_host_enable_bemp_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 113 void usb0_host_disable_bemp_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 114 void usb0_host_clear_bemp_sts(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 115 void usb0_host_enable_nrdy_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 116 void usb0_host_disable_nrdy_int(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 117 void usb0_host_clear_nrdy_sts(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 118 void usb0_host_set_pid_buf(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 119 void usb0_host_set_pid_nak(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 120 void usb0_host_set_pid_stall(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 121 void usb0_host_clear_pid_stall(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 122 uint16_t usb0_host_get_pid(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 123 void usb0_host_set_sqclr(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 124 void usb0_host_set_sqset(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 125 void usb0_host_set_csclr(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 126 void usb0_host_aclrm(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 127 void usb0_host_set_aclrm(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 128 void usb0_host_clr_aclrm(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 129 uint16_t usb0_host_get_sqmon(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 130 uint16_t usb0_host_get_inbuf(uint16_t pipe);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 131
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 132 /* ==== host ==== */
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 133 void usb0_host_init_pipe_status(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 134 int32_t usb0_host_CtrlTransStart(uint16_t devadr, uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len, uint8_t *Buf);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 135 void usb0_host_SetupStage(uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 136 void usb0_host_CtrlReadStart(uint32_t Bsize, uint8_t *Table);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 137 uint16_t usb0_host_CtrlWriteStart(uint32_t Bsize, uint8_t *Table);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 138 void usb0_host_StatusStage(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 139 void usb0_host_get_devadd(uint16_t addr, uint16_t *devadd);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 140 void usb0_host_set_devadd(uint16_t addr, uint16_t *devadd);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 141 void usb0_host_InitModule(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 142 uint16_t usb0_host_CheckAttach(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 143 void usb0_host_UsbDetach(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 144 void usb0_host_UsbDetach2(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 145 void usb0_host_UsbAttach(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 146 uint16_t usb0_host_UsbBusReset(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 147 int32_t usb0_host_UsbResume(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 148 int32_t usb0_host_UsbSuspend(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 149 void usb0_host_Enable_DetachINT(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 150 void usb0_host_Disable_DetachINT(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 151 void usb0_host_UsbStateManager(void);
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 152
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 153
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 154 #endif /* USB0_HOST_H */
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 155
frq08711@LMECWL0871.LME.ST.COM 1:ab240722d7ef 156 /* End of File */