Keyboard firmwares for Atmel AVR and Cortex-M
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

usb_host.h 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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_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 USB_HOST_H
  30. #define USB_HOST_H
  31. /*******************************************************************************
  32. Includes <System Includes> , "Project Includes"
  33. *******************************************************************************/
  34. #include "r_typedefs.h"
  35. #include "iodefine.h"
  36. #include "rza_io_regrw.h"
  37. /*******************************************************************************
  38. Typedef definitions
  39. *******************************************************************************/
  40. /*******************************************************************************
  41. Macro definitions
  42. *******************************************************************************/
  43. #define USB_HOST_DEVICE_0 (0u)
  44. #define USB_HOST_DEVICE_1 (1u)
  45. #define USB_HOST_DEVICE_2 (2u)
  46. #define USB_HOST_DEVICE_3 (3u)
  47. #define USB_HOST_DEVICE_4 (4u)
  48. #define USB_HOST_DEVICE_5 (5u)
  49. #define USB_HOST_DEVICE_6 (6u)
  50. #define USB_HOST_DEVICE_7 (7u)
  51. #define USB_HOST_DEVICE_8 (8u)
  52. #define USB_HOST_DEVICE_9 (9u)
  53. #define USB_HOST_DEVICE_10 (10u)
  54. #define USB_HOST_ENDPOINT_DESC (0x05)
  55. #define USB_HOST_BITUPLLE (0x0002u)
  56. #define USB_HOST_BITUCKSEL (0x0004u)
  57. #define USB_HOST_BITBWAIT (0x003fu)
  58. #define USB_HOST_BUSWAIT_02 (0x0000u)
  59. #define USB_HOST_BUSWAIT_03 (0x0001u)
  60. #define USB_HOST_BUSWAIT_04 (0x0002u)
  61. #define USB_HOST_BUSWAIT_05 (0x0003u)
  62. #define USB_HOST_BUSWAIT_06 (0x0004u)
  63. #define USB_HOST_BUSWAIT_07 (0x0005u)
  64. #define USB_HOST_BUSWAIT_08 (0x0006u)
  65. #define USB_HOST_BUSWAIT_09 (0x0007u)
  66. #define USB_HOST_BUSWAIT_10 (0x0008u)
  67. #define USB_HOST_BUSWAIT_11 (0x0009u)
  68. #define USB_HOST_BUSWAIT_12 (0x000au)
  69. #define USB_HOST_BUSWAIT_13 (0x000bu)
  70. #define USB_HOST_BUSWAIT_14 (0x000cu)
  71. #define USB_HOST_BUSWAIT_15 (0x000du)
  72. #define USB_HOST_BUSWAIT_16 (0x000eu)
  73. #define USB_HOST_BUSWAIT_17 (0x000fu)
  74. #define USB_HOST_FS_JSTS (0x0001u)
  75. #define USB_HOST_LS_JSTS (0x0002u)
  76. #define USB_HOST_BITRST (0x0040u)
  77. #define USB_HOST_BITRESUME (0x0020u)
  78. #define USB_HOST_BITUACT (0x0010u)
  79. #define USB_HOST_HSPROC (0x0004u)
  80. #define USB_HOST_HSMODE (0x0003u)
  81. #define USB_HOST_FSMODE (0x0002u)
  82. #define USB_HOST_LSMODE (0x0001u)
  83. #define USB_HOST_UNDECID (0x0000u)
  84. #define USB_HOST_BITRCNT (0x8000u)
  85. #define USB_HOST_BITDREQE (0x1000u)
  86. #define USB_HOST_BITMBW (0x0c00u)
  87. #define USB_HOST_BITMBW_8 (0x0000u)
  88. #define USB_HOST_BITMBW_16 (0x0400u)
  89. #define USB_HOST_BITMBW_32 (0x0800u)
  90. #define USB_HOST_BITBYTE_LITTLE (0x0000u)
  91. #define USB_HOST_BITBYTE_BIG (0x0100u)
  92. #define USB_HOST_BITISEL (0x0020u)
  93. #define USB_HOST_BITCURPIPE (0x000fu)
  94. #define USB_HOST_CFIFO_READ (0x0000u)
  95. #define USB_HOST_CFIFO_WRITE (0x0020u)
  96. #define USB_HOST_BITBVAL (0x8000u)
  97. #define USB_HOST_BITBCLR (0x4000u)
  98. #define USB_HOST_BITFRDY (0x2000u)
  99. #define USB_HOST_BITDTLN (0x0fffu)
  100. #define USB_HOST_BITBEMPE (0x0400u)
  101. #define USB_HOST_BITNRDYE (0x0200u)
  102. #define USB_HOST_BITBRDYE (0x0100u)
  103. #define USB_HOST_BITBEMP (0x0400u)
  104. #define USB_HOST_BITNRDY (0x0200u)
  105. #define USB_HOST_BITBRDY (0x0100u)
  106. #define USB_HOST_BITBCHGE (0x4000u)
  107. #define USB_HOST_BITDTCHE (0x1000u)
  108. #define USB_HOST_BITATTCHE (0x0800u)
  109. #define USB_HOST_BITEOFERRE (0x0040u)
  110. #define USB_HOST_BITBCHG (0x4000u)
  111. #define USB_HOST_BITDTCH (0x1000u)
  112. #define USB_HOST_BITATTCH (0x0800u)
  113. #define USB_HOST_BITEOFERR (0x0040u)
  114. #define USB_HOST_BITSIGNE (0x0020u)
  115. #define USB_HOST_BITSACKE (0x0010u)
  116. #define USB_HOST_BITSIGN (0x0020u)
  117. #define USB_HOST_BITSACK (0x0010u)
  118. #define USB_HOST_BITSUREQ (0x4000u)
  119. #define USB_HOST_BITSQSET (0x0080u)
  120. #define USB_HOST_PID_STALL2 (0x0003u)
  121. #define USB_HOST_PID_STALL (0x0002u)
  122. #define USB_HOST_PID_BUF (0x0001u)
  123. #define USB_HOST_PID_NAK (0x0000u)
  124. #define USB_HOST_PIPExBUF (64u)
  125. #define USB_HOST_D0FIFO (0)
  126. #define USB_HOST_D1FIFO (1)
  127. #define USB_HOST_DMA_READY (0)
  128. #define USB_HOST_DMA_BUSY (1)
  129. #define USB_HOST_DMA_BUSYEND (2)
  130. #define USB_HOST_FIFO_USE (0x7000)
  131. #define USB_HOST_FIFOERROR (0xffff)
  132. #define USB_HOST_WRITEEND (0)
  133. #define USB_HOST_WRITESHRT (1)
  134. #define USB_HOST_WRITING (2)
  135. #define USB_HOST_WRITEDMA (3)
  136. #define USB_HOST_READEND (0)
  137. #define USB_HOST_READSHRT (1)
  138. #define USB_HOST_READING (2)
  139. #define USB_HOST_READOVER (3)
  140. #define USB_HOST_READZERO (4)
  141. #define USB_HOST_CMD_IDLE (0x0000)
  142. #define USB_HOST_CMD_DOING (0x0001)
  143. #define USB_HOST_CMD_DONE (0x0002)
  144. #define USB_HOST_CMD_NORES (0x0003)
  145. #define USB_HOST_CMD_STALL (0x0004)
  146. #define USB_HOST_CMD_FIELD (0x000f)
  147. #if 0
  148. #define USB_HOST_CHG_CMDFIELD( r, v ) do { r &= ( ~USB_HOST_CMD_FIELD ); \
  149. r |= v; } while(0)
  150. #endif
  151. #define USB_HOST_MODE_WRITE (0x0100)
  152. #define USB_HOST_MODE_READ (0x0200)
  153. #define USB_HOST_MODE_NO_DATA (0x0300)
  154. #define USB_HOST_MODE_FIELD (0x0f00)
  155. #define USB_HOST_STAGE_SETUP (0x0010)
  156. #define USB_HOST_STAGE_DATA (0x0020)
  157. #define USB_HOST_STAGE_STATUS (0x0030)
  158. #define USB_HOST_STAGE_FIELD (0x00f0)
  159. #if 0
  160. #define USB_HOST_CHG_STAGEFIELD( r, v ) do { r &= ( ~USB_HOST_STAGE_FIELD ); \
  161. r |= v; } while(0)
  162. #endif
  163. #define USB_HOST_DEVADD_MASK (0x7fc0)
  164. /*******************************************************************************
  165. Imported global variables and functions (from other files)
  166. *******************************************************************************/
  167. extern uint16_t g_usb_host_elt_clockmode;
  168. #endif /* USB_HOST_H */
  169. /* End of File */