Keyboard firmwares for Atmel AVR and Cortex-M
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

usb0_host.h 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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_host.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_HOST_H
  30. #define USB0_HOST_H
  31. /*******************************************************************************
  32. Includes <System Includes> , "Project Includes"
  33. *******************************************************************************/
  34. #include "devdrv_usb_host_api.h"
  35. #include "usb_host.h"
  36. /*******************************************************************************
  37. Imported global variables and functions (from other files)
  38. *******************************************************************************/
  39. extern const uint16_t g_usb0_host_bit_set[];
  40. extern uint32_t g_usb0_host_data_count[USB_HOST_MAX_PIPE_NO + 1];
  41. extern uint8_t *g_usb0_host_data_pointer[USB_HOST_MAX_PIPE_NO + 1];
  42. extern uint16_t g_usb0_host_PipeIgnore[];
  43. extern uint16_t g_usb0_host_PipeTbl[];
  44. extern uint16_t g_usb0_host_pipe_status[];
  45. extern uint32_t g_usb0_host_PipeDataSize[];
  46. extern USB_HOST_DMA_t g_usb0_host_DmaInfo[];
  47. extern uint16_t g_usb0_host_DmaPipe[];
  48. extern uint16_t g_usb0_host_DmaBval[];
  49. extern uint16_t g_usb0_host_DmaStatus[];
  50. extern uint16_t g_usb0_host_driver_state;
  51. extern uint16_t g_usb0_host_ConfigNum;
  52. extern uint16_t g_usb0_host_CmdStage;
  53. extern uint16_t g_usb0_host_bchg_flag;
  54. extern uint16_t g_usb0_host_detach_flag;
  55. extern uint16_t g_usb0_host_attach_flag;
  56. extern uint16_t g_usb0_host_UsbAddress;
  57. extern uint16_t g_usb0_host_setUsbAddress;
  58. extern uint16_t g_usb0_host_default_max_packet[USB_HOST_MAX_DEVICE + 1];
  59. extern uint16_t g_usb0_host_UsbDeviceSpeed;
  60. extern uint16_t g_usb0_host_SupportUsbDeviceSpeed;
  61. extern uint16_t g_usb0_host_SavReq;
  62. extern uint16_t g_usb0_host_SavVal;
  63. extern uint16_t g_usb0_host_SavIndx;
  64. extern uint16_t g_usb0_host_SavLen;
  65. extern uint16_t g_usb0_host_pipecfg[USB_HOST_MAX_PIPE_NO + 1];
  66. extern uint16_t g_usb0_host_pipebuf[USB_HOST_MAX_PIPE_NO + 1];
  67. extern uint16_t g_usb0_host_pipemaxp[USB_HOST_MAX_PIPE_NO + 1];
  68. extern uint16_t g_usb0_host_pipeperi[USB_HOST_MAX_PIPE_NO + 1];
  69. /*******************************************************************************
  70. Functions Prototypes
  71. *******************************************************************************/
  72. /* ==== common ==== */
  73. void usb0_host_dma_stop_d0(uint16_t pipe, uint32_t remain);
  74. void usb0_host_dma_stop_d1(uint16_t pipe, uint32_t remain);
  75. uint16_t usb0_host_is_hispeed(void);
  76. uint16_t usb0_host_is_hispeed_enable(void);
  77. uint16_t usb0_host_start_send_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
  78. uint16_t usb0_host_write_buffer(uint16_t pipe);
  79. uint16_t usb0_host_write_buffer_c(uint16_t pipe);
  80. uint16_t usb0_host_write_buffer_d0(uint16_t pipe);
  81. uint16_t usb0_host_write_buffer_d1(uint16_t pipe);
  82. void usb0_host_start_receive_transfer(uint16_t pipe, uint32_t size, uint8_t *data);
  83. uint16_t usb0_host_read_buffer(uint16_t pipe);
  84. uint16_t usb0_host_read_buffer_c(uint16_t pipe);
  85. uint16_t usb0_host_read_buffer_d0(uint16_t pipe);
  86. uint16_t usb0_host_read_buffer_d1(uint16_t pipe);
  87. uint16_t usb0_host_change_fifo_port(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
  88. void usb0_host_set_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw);
  89. void usb0_host_set_curpipe2(uint16_t pipe, uint16_t fifosel, uint16_t isel, uint16_t mbw, uint16_t dfacc);
  90. uint16_t usb0_host_get_mbw(uint32_t trncount, uint32_t dtptr);
  91. uint16_t usb0_host_read_dma(uint16_t pipe);
  92. void usb0_host_stop_transfer(uint16_t pipe);
  93. void usb0_host_brdy_int(uint16_t status, uint16_t int_enb);
  94. void usb0_host_nrdy_int(uint16_t status, uint16_t int_enb);
  95. void usb0_host_bemp_int(uint16_t status, uint16_t int_enb);
  96. void usb0_host_setting_interrupt(uint8_t level);
  97. void usb0_host_reset_module(uint16_t clockmode);
  98. uint16_t usb0_host_get_buf_size(uint16_t pipe);
  99. uint16_t usb0_host_get_mxps(uint16_t pipe);
  100. void usb0_host_enable_brdy_int(uint16_t pipe);
  101. void usb0_host_disable_brdy_int(uint16_t pipe);
  102. void usb0_host_clear_brdy_sts(uint16_t pipe);
  103. void usb0_host_enable_bemp_int(uint16_t pipe);
  104. void usb0_host_disable_bemp_int(uint16_t pipe);
  105. void usb0_host_clear_bemp_sts(uint16_t pipe);
  106. void usb0_host_enable_nrdy_int(uint16_t pipe);
  107. void usb0_host_disable_nrdy_int(uint16_t pipe);
  108. void usb0_host_clear_nrdy_sts(uint16_t pipe);
  109. void usb0_host_set_pid_buf(uint16_t pipe);
  110. void usb0_host_set_pid_nak(uint16_t pipe);
  111. void usb0_host_set_pid_stall(uint16_t pipe);
  112. void usb0_host_clear_pid_stall(uint16_t pipe);
  113. uint16_t usb0_host_get_pid(uint16_t pipe);
  114. void usb0_host_set_sqclr(uint16_t pipe);
  115. void usb0_host_set_sqset(uint16_t pipe);
  116. void usb0_host_set_csclr(uint16_t pipe);
  117. void usb0_host_aclrm(uint16_t pipe);
  118. void usb0_host_set_aclrm(uint16_t pipe);
  119. void usb0_host_clr_aclrm(uint16_t pipe);
  120. uint16_t usb0_host_get_sqmon(uint16_t pipe);
  121. uint16_t usb0_host_get_inbuf(uint16_t pipe);
  122. /* ==== host ==== */
  123. void usb0_host_init_pipe_status(void);
  124. int32_t usb0_host_CtrlTransStart(uint16_t devadr, uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len, uint8_t *Buf);
  125. void usb0_host_SetupStage(uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len);
  126. void usb0_host_CtrlReadStart(uint32_t Bsize, uint8_t *Table);
  127. uint16_t usb0_host_CtrlWriteStart(uint32_t Bsize, uint8_t *Table);
  128. void usb0_host_StatusStage(void);
  129. void usb0_host_get_devadd(uint16_t addr, uint16_t *devadd);
  130. void usb0_host_set_devadd(uint16_t addr, uint16_t *devadd);
  131. void usb0_host_InitModule(void);
  132. uint16_t usb0_host_CheckAttach(void);
  133. void usb0_host_UsbDetach(void);
  134. void usb0_host_UsbDetach2(void);
  135. void usb0_host_UsbAttach(void);
  136. uint16_t usb0_host_UsbBusReset(void);
  137. int32_t usb0_host_UsbResume(void);
  138. int32_t usb0_host_UsbSuspend(void);
  139. void usb0_host_Enable_DetachINT(void);
  140. void usb0_host_Disable_DetachINT(void);
  141. void usb0_host_UsbStateManager(void);
  142. #endif /* USB0_HOST_H */
  143. /* End of File */