USBFS_1.h 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. /*******************************************************************************
  2. * File Name: USBFS_1.h
  3. * Version 2.60
  4. *
  5. * Description:
  6. * Header File for the USFS component. Contains prototypes and constant values.
  7. *
  8. ********************************************************************************
  9. * Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
  10. * You may use this file only in accordance with the license, terms, conditions,
  11. * disclaimers, and limitations in the end user license agreement accompanying
  12. * the software package with which this file was provided.
  13. *******************************************************************************/
  14. #if !defined(CY_USBFS_USBFS_1_H)
  15. #define CY_USBFS_USBFS_1_H
  16. #include "cytypes.h"
  17. #include "cydevice_trm.h"
  18. #include "cyfitter.h"
  19. #include "CyLib.h"
  20. /***************************************
  21. * Conditional Compilation Parameters
  22. ***************************************/
  23. /* Check to see if required defines such as CY_PSOC5LP are available */
  24. /* They are defined starting with cy_boot v3.0 */
  25. #if !defined (CY_PSOC5LP)
  26. #error Component USBFS_v2_60 requires cy_boot v3.0 or later
  27. #endif /* (CY_PSOC5LP) */
  28. /***************************************
  29. * Memory Type Definitions
  30. ***************************************/
  31. /* Renamed Type Definitions for backward compatibility.
  32. * Should not be used in new designs.
  33. */
  34. #define USBFS_1_CODE CYCODE
  35. #define USBFS_1_FAR CYFAR
  36. #if defined(__C51__) || defined(__CX51__)
  37. #define USBFS_1_DATA data
  38. #define USBFS_1_XDATA xdata
  39. #else
  40. #define USBFS_1_DATA
  41. #define USBFS_1_XDATA
  42. #endif /* End __C51__ */
  43. #define USBFS_1_NULL NULL
  44. /***************************************
  45. * Enumerated Types and Parameters
  46. ***************************************/
  47. #define USBFS_1__EP_MANUAL 0
  48. #define USBFS_1__EP_DMAMANUAL 1
  49. #define USBFS_1__EP_DMAAUTO 2
  50. #define USBFS_1__MA_STATIC 0
  51. #define USBFS_1__MA_DYNAMIC 1
  52. /***************************************
  53. * Initial Parameter Constants
  54. ***************************************/
  55. #define USBFS_1_NUM_DEVICES (1u)
  56. #define USBFS_1_MAX_REPORTID_NUMBER (0u)
  57. #define USBFS_1_MON_VBUS (0u)
  58. #define USBFS_1_EXTERN_VBUS (0u)
  59. #define USBFS_1_EXTERN_VND (0u)
  60. #define USBFS_1_EXTERN_CLS (0u)
  61. #define USBFS_1_MAX_INTERFACES_NUMBER (1u)
  62. #define USBFS_1_EP0_ISR_REMOVE (0u)
  63. #define USBFS_1_EP1_ISR_REMOVE (0u)
  64. #define USBFS_1_EP2_ISR_REMOVE (1u)
  65. #define USBFS_1_EP3_ISR_REMOVE (1u)
  66. #define USBFS_1_EP4_ISR_REMOVE (1u)
  67. #define USBFS_1_EP5_ISR_REMOVE (1u)
  68. #define USBFS_1_EP6_ISR_REMOVE (1u)
  69. #define USBFS_1_EP7_ISR_REMOVE (1u)
  70. #define USBFS_1_EP8_ISR_REMOVE (1u)
  71. #define USBFS_1_EP_MM (0u)
  72. #define USBFS_1_EP_MA (0u)
  73. #define USBFS_1_DMA1_REMOVE (1u)
  74. #define USBFS_1_DMA2_REMOVE (1u)
  75. #define USBFS_1_DMA3_REMOVE (1u)
  76. #define USBFS_1_DMA4_REMOVE (1u)
  77. #define USBFS_1_DMA5_REMOVE (1u)
  78. #define USBFS_1_DMA6_REMOVE (1u)
  79. #define USBFS_1_DMA7_REMOVE (1u)
  80. #define USBFS_1_DMA8_REMOVE (1u)
  81. #define USBFS_1_SOF_ISR_REMOVE (0u)
  82. #define USBFS_1_ARB_ISR_REMOVE (0u)
  83. #define USBFS_1_DP_ISR_REMOVE (0u)
  84. #define USBFS_1_ENABLE_CDC_CLASS_API (1u)
  85. #define USBFS_1_ENABLE_MIDI_API (1u)
  86. #define USBFS_1_MIDI_EXT_MODE (0u)
  87. /***************************************
  88. * Data Struct Definition
  89. ***************************************/
  90. typedef struct
  91. {
  92. uint8 attrib;
  93. uint8 apiEpState;
  94. uint8 hwEpState;
  95. uint8 epToggle;
  96. uint8 addr;
  97. uint8 epMode;
  98. uint16 buffOffset;
  99. uint16 bufferSize;
  100. uint8 interface;
  101. } T_USBFS_1_EP_CTL_BLOCK;
  102. typedef struct
  103. {
  104. uint8 interface;
  105. uint8 altSetting;
  106. uint8 addr;
  107. uint8 attributes;
  108. uint16 bufferSize;
  109. uint8 bMisc;
  110. } T_USBFS_1_EP_SETTINGS_BLOCK;
  111. typedef struct
  112. {
  113. uint8 status;
  114. uint16 length;
  115. } T_USBFS_1_XFER_STATUS_BLOCK;
  116. typedef struct
  117. {
  118. uint16 count;
  119. volatile uint8 *pData;
  120. T_USBFS_1_XFER_STATUS_BLOCK *pStatusBlock;
  121. } T_USBFS_1_TD;
  122. typedef struct
  123. {
  124. uint8 c;
  125. const void *p_list;
  126. } T_USBFS_1_LUT;
  127. /* Resume/Suspend API Support */
  128. typedef struct
  129. {
  130. uint8 enableState;
  131. uint8 mode;
  132. } USBFS_1_BACKUP_STRUCT;
  133. /* Renamed structure fields for backward compatibility.
  134. * Should not be used in new designs.
  135. */
  136. #define wBuffOffset buffOffset
  137. #define wBufferSize bufferSize
  138. #define bStatus status
  139. #define wLength length
  140. #define wCount count
  141. /* Renamed global variable for backward compatibility.
  142. * Should not be used in new designs.
  143. */
  144. #define CurrentTD USBFS_1_currentTD
  145. /***************************************
  146. * Function Prototypes
  147. ***************************************/
  148. void USBFS_1_Start(uint8 device, uint8 mode) ;
  149. void USBFS_1_Init(void) ;
  150. void USBFS_1_InitComponent(uint8 device, uint8 mode) ;
  151. void USBFS_1_Stop(void) ;
  152. uint8 USBFS_1_CheckActivity(void) ;
  153. uint8 USBFS_1_GetConfiguration(void) ;
  154. uint8 USBFS_1_IsConfigurationChanged(void) ;
  155. uint8 USBFS_1_GetInterfaceSetting(uint8 interfaceNumber)
  156. ;
  157. uint8 USBFS_1_GetEPState(uint8 epNumber) ;
  158. uint16 USBFS_1_GetEPCount(uint8 epNumber) ;
  159. void USBFS_1_LoadInEP(uint8 epNumber, const uint8 pData[], uint16 length)
  160. ;
  161. uint16 USBFS_1_ReadOutEP(uint8 epNumber, uint8 pData[], uint16 length)
  162. ;
  163. void USBFS_1_EnableOutEP(uint8 epNumber) ;
  164. void USBFS_1_DisableOutEP(uint8 epNumber) ;
  165. void USBFS_1_Force(uint8 bState) ;
  166. uint8 USBFS_1_GetEPAckState(uint8 epNumber) ;
  167. void USBFS_1_SetPowerStatus(uint8 powerStatus) ;
  168. uint8 USBFS_1_RWUEnabled(void) ;
  169. void USBFS_1_TerminateEP(uint8 ep) ;
  170. void USBFS_1_Suspend(void) ;
  171. void USBFS_1_Resume(void) ;
  172. #if defined(USBFS_1_ENABLE_FWSN_STRING)
  173. void USBFS_1_SerialNumString(uint8 snString[]) ;
  174. #endif /* USBFS_1_ENABLE_FWSN_STRING */
  175. #if (USBFS_1_MON_VBUS == 1u)
  176. uint8 USBFS_1_VBusPresent(void) ;
  177. #endif /* End USBFS_1_MON_VBUS */
  178. #if defined(CYDEV_BOOTLOADER_IO_COMP) && ((CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1) || \
  179. (CYDEV_BOOTLOADER_IO_COMP == CyBtldr_Custom_Interface))
  180. void USBFS_1_CyBtldrCommStart(void) ;
  181. void USBFS_1_CyBtldrCommStop(void) ;
  182. void USBFS_1_CyBtldrCommReset(void) ;
  183. cystatus USBFS_1_CyBtldrCommWrite(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL
  184. ;
  185. cystatus USBFS_1_CyBtldrCommRead( uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL
  186. ;
  187. #define USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER (64u) /* EP 1 OUT */
  188. #define USBFS_1_BTLDR_SIZEOF_READ_BUFFER (64u) /* EP 2 IN */
  189. #define USBFS_1_BTLDR_MAX_PACKET_SIZE USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER
  190. /* These defines active if used USBFS interface as an
  191. * IO Component for bootloading. When Custom_Interface selected
  192. * in Bootloder configuration as the IO Component, user must
  193. * provide these functions
  194. */
  195. #if (CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1)
  196. #define CyBtldrCommStart USBFS_1_CyBtldrCommStart
  197. #define CyBtldrCommStop USBFS_1_CyBtldrCommStop
  198. #define CyBtldrCommReset USBFS_1_CyBtldrCommReset
  199. #define CyBtldrCommWrite USBFS_1_CyBtldrCommWrite
  200. #define CyBtldrCommRead USBFS_1_CyBtldrCommRead
  201. #endif /*End CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1 */
  202. #endif /* End CYDEV_BOOTLOADER_IO_COMP */
  203. #if(USBFS_1_EP_MM != USBFS_1__EP_MANUAL)
  204. void USBFS_1_InitEP_DMA(uint8 epNumber, const uint8 *pData)
  205. ;
  206. void USBFS_1_Stop_DMA(uint8 epNumber) ;
  207. #endif /* End USBFS_1_EP_MM != USBFS_1__EP_MANUAL) */
  208. #if defined(USBFS_1_ENABLE_MIDI_STREAMING) && (USBFS_1_ENABLE_MIDI_API != 0u)
  209. void USBFS_1_MIDI_EP_Init(void) ;
  210. #if (USBFS_1_MIDI_IN_BUFF_SIZE > 0)
  211. void USBFS_1_MIDI_IN_Service(void) ;
  212. uint8 USBFS_1_PutUsbMidiIn(uint8 ic, const uint8 midiMsg[], uint8 cable)
  213. ;
  214. #endif /* USBFS_1_MIDI_IN_BUFF_SIZE > 0 */
  215. #if (USBFS_1_MIDI_OUT_BUFF_SIZE > 0)
  216. void USBFS_1_MIDI_OUT_EP_Service(void) ;
  217. #endif /* USBFS_1_MIDI_OUT_BUFF_SIZE > 0 */
  218. #endif /* End USBFS_1_ENABLE_MIDI_API != 0u */
  219. /* Renamed Functions for backward compatibility.
  220. * Should not be used in new designs.
  221. */
  222. #define USBFS_1_bCheckActivity USBFS_1_CheckActivity
  223. #define USBFS_1_bGetConfiguration USBFS_1_GetConfiguration
  224. #define USBFS_1_bGetInterfaceSetting USBFS_1_GetInterfaceSetting
  225. #define USBFS_1_bGetEPState USBFS_1_GetEPState
  226. #define USBFS_1_wGetEPCount USBFS_1_GetEPCount
  227. #define USBFS_1_bGetEPAckState USBFS_1_GetEPAckState
  228. #define USBFS_1_bRWUEnabled USBFS_1_RWUEnabled
  229. #define USBFS_1_bVBusPresent USBFS_1_VBusPresent
  230. #define USBFS_1_bConfiguration USBFS_1_configuration
  231. #define USBFS_1_bInterfaceSetting USBFS_1_interfaceSetting
  232. #define USBFS_1_bDeviceAddress USBFS_1_deviceAddress
  233. #define USBFS_1_bDeviceStatus USBFS_1_deviceStatus
  234. #define USBFS_1_bDevice USBFS_1_device
  235. #define USBFS_1_bTransferState USBFS_1_transferState
  236. #define USBFS_1_bLastPacketSize USBFS_1_lastPacketSize
  237. #define USBFS_1_LoadEP USBFS_1_LoadInEP
  238. #define USBFS_1_LoadInISOCEP USBFS_1_LoadInEP
  239. #define USBFS_1_EnableOutISOCEP USBFS_1_EnableOutEP
  240. #define USBFS_1_SetVector CyIntSetVector
  241. #define USBFS_1_SetPriority CyIntSetPriority
  242. #define USBFS_1_EnableInt CyIntEnable
  243. /***************************************
  244. * API Constants
  245. ***************************************/
  246. #define USBFS_1_EP0 (0u)
  247. #define USBFS_1_EP1 (1u)
  248. #define USBFS_1_EP2 (2u)
  249. #define USBFS_1_EP3 (3u)
  250. #define USBFS_1_EP4 (4u)
  251. #define USBFS_1_EP5 (5u)
  252. #define USBFS_1_EP6 (6u)
  253. #define USBFS_1_EP7 (7u)
  254. #define USBFS_1_EP8 (8u)
  255. #define USBFS_1_MAX_EP (9u)
  256. #define USBFS_1_TRUE (1u)
  257. #define USBFS_1_FALSE (0u)
  258. #define USBFS_1_NO_EVENT_ALLOWED (2u)
  259. #define USBFS_1_EVENT_PENDING (1u)
  260. #define USBFS_1_NO_EVENT_PENDING (0u)
  261. #define USBFS_1_IN_BUFFER_FULL USBFS_1_NO_EVENT_PENDING
  262. #define USBFS_1_IN_BUFFER_EMPTY USBFS_1_EVENT_PENDING
  263. #define USBFS_1_OUT_BUFFER_FULL USBFS_1_EVENT_PENDING
  264. #define USBFS_1_OUT_BUFFER_EMPTY USBFS_1_NO_EVENT_PENDING
  265. #define USBFS_1_FORCE_J (0xA0u)
  266. #define USBFS_1_FORCE_K (0x80u)
  267. #define USBFS_1_FORCE_SE0 (0xC0u)
  268. #define USBFS_1_FORCE_NONE (0x00u)
  269. #define USBFS_1_IDLE_TIMER_RUNNING (0x02u)
  270. #define USBFS_1_IDLE_TIMER_EXPIRED (0x01u)
  271. #define USBFS_1_IDLE_TIMER_INDEFINITE (0x00u)
  272. #define USBFS_1_DEVICE_STATUS_BUS_POWERED (0x00u)
  273. #define USBFS_1_DEVICE_STATUS_SELF_POWERED (0x01u)
  274. #define USBFS_1_3V_OPERATION (0x00u)
  275. #define USBFS_1_5V_OPERATION (0x01u)
  276. #define USBFS_1_DWR_VDDD_OPERATION (0x02u)
  277. #define USBFS_1_MODE_DISABLE (0x00u)
  278. #define USBFS_1_MODE_NAK_IN_OUT (0x01u)
  279. #define USBFS_1_MODE_STATUS_OUT_ONLY (0x02u)
  280. #define USBFS_1_MODE_STALL_IN_OUT (0x03u)
  281. #define USBFS_1_MODE_RESERVED_0100 (0x04u)
  282. #define USBFS_1_MODE_ISO_OUT (0x05u)
  283. #define USBFS_1_MODE_STATUS_IN_ONLY (0x06u)
  284. #define USBFS_1_MODE_ISO_IN (0x07u)
  285. #define USBFS_1_MODE_NAK_OUT (0x08u)
  286. #define USBFS_1_MODE_ACK_OUT (0x09u)
  287. #define USBFS_1_MODE_RESERVED_1010 (0x0Au)
  288. #define USBFS_1_MODE_ACK_OUT_STATUS_IN (0x0Bu)
  289. #define USBFS_1_MODE_NAK_IN (0x0Cu)
  290. #define USBFS_1_MODE_ACK_IN (0x0Du)
  291. #define USBFS_1_MODE_RESERVED_1110 (0x0Eu)
  292. #define USBFS_1_MODE_ACK_IN_STATUS_OUT (0x0Fu)
  293. #define USBFS_1_MODE_MASK (0x0Fu)
  294. #define USBFS_1_MODE_STALL_DATA_EP (0x80u)
  295. #define USBFS_1_MODE_ACKD (0x10u)
  296. #define USBFS_1_MODE_OUT_RCVD (0x20u)
  297. #define USBFS_1_MODE_IN_RCVD (0x40u)
  298. #define USBFS_1_MODE_SETUP_RCVD (0x80u)
  299. #define USBFS_1_RQST_TYPE_MASK (0x60u)
  300. #define USBFS_1_RQST_TYPE_STD (0x00u)
  301. #define USBFS_1_RQST_TYPE_CLS (0x20u)
  302. #define USBFS_1_RQST_TYPE_VND (0x40u)
  303. #define USBFS_1_RQST_DIR_MASK (0x80u)
  304. #define USBFS_1_RQST_DIR_D2H (0x80u)
  305. #define USBFS_1_RQST_DIR_H2D (0x00u)
  306. #define USBFS_1_RQST_RCPT_MASK (0x03u)
  307. #define USBFS_1_RQST_RCPT_DEV (0x00u)
  308. #define USBFS_1_RQST_RCPT_IFC (0x01u)
  309. #define USBFS_1_RQST_RCPT_EP (0x02u)
  310. #define USBFS_1_RQST_RCPT_OTHER (0x03u)
  311. /* USB Class Codes */
  312. #define USBFS_1_CLASS_DEVICE (0x00u) /* Use class code info from Interface Descriptors */
  313. #define USBFS_1_CLASS_AUDIO (0x01u) /* Audio device */
  314. #define USBFS_1_CLASS_CDC (0x02u) /* Communication device class */
  315. #define USBFS_1_CLASS_HID (0x03u) /* Human Interface Device */
  316. #define USBFS_1_CLASS_PDC (0x05u) /* Physical device class */
  317. #define USBFS_1_CLASS_IMAGE (0x06u) /* Still Imaging device */
  318. #define USBFS_1_CLASS_PRINTER (0x07u) /* Printer device */
  319. #define USBFS_1_CLASS_MSD (0x08u) /* Mass Storage device */
  320. #define USBFS_1_CLASS_HUB (0x09u) /* Full/Hi speed Hub */
  321. #define USBFS_1_CLASS_CDC_DATA (0x0Au) /* CDC data device */
  322. #define USBFS_1_CLASS_SMART_CARD (0x0Bu) /* Smart Card device */
  323. #define USBFS_1_CLASS_CSD (0x0Du) /* Content Security device */
  324. #define USBFS_1_CLASS_VIDEO (0x0Eu) /* Video device */
  325. #define USBFS_1_CLASS_PHD (0x0Fu) /* Personal Healthcare device */
  326. #define USBFS_1_CLASS_WIRELESSD (0xDCu) /* Wireless Controller */
  327. #define USBFS_1_CLASS_MIS (0xE0u) /* Miscellaneous */
  328. #define USBFS_1_CLASS_APP (0xEFu) /* Application Specific */
  329. #define USBFS_1_CLASS_VENDOR (0xFFu) /* Vendor specific */
  330. /* Standard Request Types (Table 9-4) */
  331. #define USBFS_1_GET_STATUS (0x00u)
  332. #define USBFS_1_CLEAR_FEATURE (0x01u)
  333. #define USBFS_1_SET_FEATURE (0x03u)
  334. #define USBFS_1_SET_ADDRESS (0x05u)
  335. #define USBFS_1_GET_DESCRIPTOR (0x06u)
  336. #define USBFS_1_SET_DESCRIPTOR (0x07u)
  337. #define USBFS_1_GET_CONFIGURATION (0x08u)
  338. #define USBFS_1_SET_CONFIGURATION (0x09u)
  339. #define USBFS_1_GET_INTERFACE (0x0Au)
  340. #define USBFS_1_SET_INTERFACE (0x0Bu)
  341. #define USBFS_1_SYNCH_FRAME (0x0Cu)
  342. /* Vendor Specific Request Types */
  343. /* Request for Microsoft OS String Descriptor */
  344. #define USBFS_1_GET_EXTENDED_CONFIG_DESCRIPTOR (0x01u)
  345. /* Descriptor Types (Table 9-5) */
  346. #define USBFS_1_DESCR_DEVICE (1u)
  347. #define USBFS_1_DESCR_CONFIG (2u)
  348. #define USBFS_1_DESCR_STRING (3u)
  349. #define USBFS_1_DESCR_INTERFACE (4u)
  350. #define USBFS_1_DESCR_ENDPOINT (5u)
  351. #define USBFS_1_DESCR_DEVICE_QUALIFIER (6u)
  352. #define USBFS_1_DESCR_OTHER_SPEED (7u)
  353. #define USBFS_1_DESCR_INTERFACE_POWER (8u)
  354. /* Device Descriptor Defines */
  355. #define USBFS_1_DEVICE_DESCR_LENGTH (18u)
  356. #define USBFS_1_DEVICE_DESCR_SN_SHIFT (16u)
  357. /* Config Descriptor Shifts and Masks */
  358. #define USBFS_1_CONFIG_DESCR_LENGTH (0u)
  359. #define USBFS_1_CONFIG_DESCR_TYPE (1u)
  360. #define USBFS_1_CONFIG_DESCR_TOTAL_LENGTH_LOW (2u)
  361. #define USBFS_1_CONFIG_DESCR_TOTAL_LENGTH_HI (3u)
  362. #define USBFS_1_CONFIG_DESCR_NUM_INTERFACES (4u)
  363. #define USBFS_1_CONFIG_DESCR_CONFIG_VALUE (5u)
  364. #define USBFS_1_CONFIG_DESCR_CONFIGURATION (6u)
  365. #define USBFS_1_CONFIG_DESCR_ATTRIB (7u)
  366. #define USBFS_1_CONFIG_DESCR_ATTRIB_SELF_POWERED (0x40u)
  367. #define USBFS_1_CONFIG_DESCR_ATTRIB_RWU_EN (0x20u)
  368. /* Feature Selectors (Table 9-6) */
  369. #define USBFS_1_DEVICE_REMOTE_WAKEUP (0x01u)
  370. #define USBFS_1_ENDPOINT_HALT (0x00u)
  371. #define USBFS_1_TEST_MODE (0x02u)
  372. /* USB Device Status (Figure 9-4) */
  373. #define USBFS_1_DEVICE_STATUS_BUS_POWERED (0x00u)
  374. #define USBFS_1_DEVICE_STATUS_SELF_POWERED (0x01u)
  375. #define USBFS_1_DEVICE_STATUS_REMOTE_WAKEUP (0x02u)
  376. /* USB Endpoint Status (Figure 9-4) */
  377. #define USBFS_1_ENDPOINT_STATUS_HALT (0x01u)
  378. /* USB Endpoint Directions */
  379. #define USBFS_1_DIR_IN (0x80u)
  380. #define USBFS_1_DIR_OUT (0x00u)
  381. #define USBFS_1_DIR_UNUSED (0x7Fu)
  382. /* USB Endpoint Attributes */
  383. #define USBFS_1_EP_TYPE_CTRL (0x00u)
  384. #define USBFS_1_EP_TYPE_ISOC (0x01u)
  385. #define USBFS_1_EP_TYPE_BULK (0x02u)
  386. #define USBFS_1_EP_TYPE_INT (0x03u)
  387. #define USBFS_1_EP_TYPE_MASK (0x03u)
  388. #define USBFS_1_EP_SYNC_TYPE_NO_SYNC (0x00u)
  389. #define USBFS_1_EP_SYNC_TYPE_ASYNC (0x04u)
  390. #define USBFS_1_EP_SYNC_TYPE_ADAPTIVE (0x08u)
  391. #define USBFS_1_EP_SYNC_TYPE_SYNCHRONOUS (0x0Cu)
  392. #define USBFS_1_EP_SYNC_TYPE_MASK (0x0Cu)
  393. #define USBFS_1_EP_USAGE_TYPE_DATA (0x00u)
  394. #define USBFS_1_EP_USAGE_TYPE_FEEDBACK (0x10u)
  395. #define USBFS_1_EP_USAGE_TYPE_IMPLICIT (0x20u)
  396. #define USBFS_1_EP_USAGE_TYPE_RESERVED (0x30u)
  397. #define USBFS_1_EP_USAGE_TYPE_MASK (0x30u)
  398. /* Endpoint Status defines */
  399. #define USBFS_1_EP_STATUS_LENGTH (0x02u)
  400. /* Endpoint Device defines */
  401. #define USBFS_1_DEVICE_STATUS_LENGTH (0x02u)
  402. #define USBFS_1_STATUS_LENGTH_MAX \
  403. ( (USBFS_1_EP_STATUS_LENGTH > USBFS_1_DEVICE_STATUS_LENGTH) ? \
  404. USBFS_1_EP_STATUS_LENGTH : USBFS_1_DEVICE_STATUS_LENGTH )
  405. /* Transfer Completion Notification */
  406. #define USBFS_1_XFER_IDLE (0x00u)
  407. #define USBFS_1_XFER_STATUS_ACK (0x01u)
  408. #define USBFS_1_XFER_PREMATURE (0x02u)
  409. #define USBFS_1_XFER_ERROR (0x03u)
  410. /* Driver State defines */
  411. #define USBFS_1_TRANS_STATE_IDLE (0x00u)
  412. #define USBFS_1_TRANS_STATE_CONTROL_READ (0x02u)
  413. #define USBFS_1_TRANS_STATE_CONTROL_WRITE (0x04u)
  414. #define USBFS_1_TRANS_STATE_NO_DATA_CONTROL (0x06u)
  415. /* String Descriptor defines */
  416. #define USBFS_1_STRING_MSOS (0xEEu)
  417. #define USBFS_1_MSOS_DESCRIPTOR_LENGTH (18u)
  418. #define USBFS_1_MSOS_CONF_DESCR_LENGTH (40u)
  419. #if(USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL)
  420. /* DMA manual mode defines */
  421. #define USBFS_1_DMA_BYTES_PER_BURST (0u)
  422. #define USBFS_1_DMA_REQUEST_PER_BURST (0u)
  423. #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAMANUAL */
  424. #if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)
  425. /* DMA automatic mode defines */
  426. #define USBFS_1_DMA_BYTES_PER_BURST (32u)
  427. /* BUF_SIZE-BYTES_PER_BURST examples: 55-32 bytes 44-16 bytes 33-8 bytes 22-4 bytes 11-2 bytes */
  428. #define USBFS_1_DMA_BUF_SIZE (0x55u)
  429. #define USBFS_1_DMA_REQUEST_PER_BURST (1u)
  430. #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */
  431. /* DIE ID string descriptor defines */
  432. #if defined(USBFS_1_ENABLE_IDSN_STRING)
  433. #define USBFS_1_IDSN_DESCR_LENGTH (0x22u)
  434. #endif /* USBFS_1_ENABLE_IDSN_STRING */
  435. /***************************************
  436. * External data references
  437. ***************************************/
  438. extern uint8 USBFS_1_initVar;
  439. extern volatile uint8 USBFS_1_device;
  440. extern volatile uint8 USBFS_1_transferState;
  441. extern volatile uint8 USBFS_1_configuration;
  442. extern volatile uint8 USBFS_1_configurationChanged;
  443. extern volatile uint8 USBFS_1_deviceStatus;
  444. /* HID Variables */
  445. #if defined(USBFS_1_ENABLE_HID_CLASS)
  446. extern volatile uint8 USBFS_1_hidProtocol[USBFS_1_MAX_INTERFACES_NUMBER];
  447. extern volatile uint8 USBFS_1_hidIdleRate[USBFS_1_MAX_INTERFACES_NUMBER];
  448. extern volatile uint8 USBFS_1_hidIdleTimer[USBFS_1_MAX_INTERFACES_NUMBER];
  449. #endif /* USBFS_1_ENABLE_HID_CLASS */
  450. /***************************************
  451. * Registers
  452. ***************************************/
  453. #define USBFS_1_ARB_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_CFG)
  454. #define USBFS_1_ARB_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_CFG)
  455. #define USBFS_1_ARB_EP1_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP1_CFG)
  456. #define USBFS_1_ARB_EP1_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP1_CFG)
  457. #define USBFS_1_ARB_EP1_CFG_IND USBFS_1_USB__ARB_EP1_CFG
  458. #define USBFS_1_ARB_EP1_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP1_INT_EN)
  459. #define USBFS_1_ARB_EP1_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP1_INT_EN)
  460. #define USBFS_1_ARB_EP1_INT_EN_IND USBFS_1_USB__ARB_EP1_INT_EN
  461. #define USBFS_1_ARB_EP1_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP1_SR)
  462. #define USBFS_1_ARB_EP1_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP1_SR)
  463. #define USBFS_1_ARB_EP1_SR_IND USBFS_1_USB__ARB_EP1_SR
  464. #define USBFS_1_ARB_EP2_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP2_CFG)
  465. #define USBFS_1_ARB_EP2_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP2_CFG)
  466. #define USBFS_1_ARB_EP2_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP2_INT_EN)
  467. #define USBFS_1_ARB_EP2_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP2_INT_EN)
  468. #define USBFS_1_ARB_EP2_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP2_SR)
  469. #define USBFS_1_ARB_EP2_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP2_SR)
  470. #define USBFS_1_ARB_EP3_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP3_CFG)
  471. #define USBFS_1_ARB_EP3_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP3_CFG)
  472. #define USBFS_1_ARB_EP3_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP3_INT_EN)
  473. #define USBFS_1_ARB_EP3_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP3_INT_EN)
  474. #define USBFS_1_ARB_EP3_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP3_SR)
  475. #define USBFS_1_ARB_EP3_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP3_SR)
  476. #define USBFS_1_ARB_EP4_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP4_CFG)
  477. #define USBFS_1_ARB_EP4_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP4_CFG)
  478. #define USBFS_1_ARB_EP4_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP4_INT_EN)
  479. #define USBFS_1_ARB_EP4_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP4_INT_EN)
  480. #define USBFS_1_ARB_EP4_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP4_SR)
  481. #define USBFS_1_ARB_EP4_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP4_SR)
  482. #define USBFS_1_ARB_EP5_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP5_CFG)
  483. #define USBFS_1_ARB_EP5_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP5_CFG)
  484. #define USBFS_1_ARB_EP5_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP5_INT_EN)
  485. #define USBFS_1_ARB_EP5_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP5_INT_EN)
  486. #define USBFS_1_ARB_EP5_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP5_SR)
  487. #define USBFS_1_ARB_EP5_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP5_SR)
  488. #define USBFS_1_ARB_EP6_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP6_CFG)
  489. #define USBFS_1_ARB_EP6_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP6_CFG)
  490. #define USBFS_1_ARB_EP6_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP6_INT_EN)
  491. #define USBFS_1_ARB_EP6_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP6_INT_EN)
  492. #define USBFS_1_ARB_EP6_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP6_SR)
  493. #define USBFS_1_ARB_EP6_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP6_SR)
  494. #define USBFS_1_ARB_EP7_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP7_CFG)
  495. #define USBFS_1_ARB_EP7_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP7_CFG)
  496. #define USBFS_1_ARB_EP7_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP7_INT_EN)
  497. #define USBFS_1_ARB_EP7_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP7_INT_EN)
  498. #define USBFS_1_ARB_EP7_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP7_SR)
  499. #define USBFS_1_ARB_EP7_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP7_SR)
  500. #define USBFS_1_ARB_EP8_CFG_PTR ( (reg8 *) USBFS_1_USB__ARB_EP8_CFG)
  501. #define USBFS_1_ARB_EP8_CFG_REG (* (reg8 *) USBFS_1_USB__ARB_EP8_CFG)
  502. #define USBFS_1_ARB_EP8_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_EP8_INT_EN)
  503. #define USBFS_1_ARB_EP8_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_EP8_INT_EN)
  504. #define USBFS_1_ARB_EP8_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_EP8_SR)
  505. #define USBFS_1_ARB_EP8_SR_REG (* (reg8 *) USBFS_1_USB__ARB_EP8_SR)
  506. #define USBFS_1_ARB_INT_EN_PTR ( (reg8 *) USBFS_1_USB__ARB_INT_EN)
  507. #define USBFS_1_ARB_INT_EN_REG (* (reg8 *) USBFS_1_USB__ARB_INT_EN)
  508. #define USBFS_1_ARB_INT_SR_PTR ( (reg8 *) USBFS_1_USB__ARB_INT_SR)
  509. #define USBFS_1_ARB_INT_SR_REG (* (reg8 *) USBFS_1_USB__ARB_INT_SR)
  510. #define USBFS_1_ARB_RW1_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_DR)
  511. #define USBFS_1_ARB_RW1_DR_IND USBFS_1_USB__ARB_RW1_DR
  512. #define USBFS_1_ARB_RW1_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_RA)
  513. #define USBFS_1_ARB_RW1_RA_IND USBFS_1_USB__ARB_RW1_RA
  514. #define USBFS_1_ARB_RW1_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_RA_MSB)
  515. #define USBFS_1_ARB_RW1_RA_MSB_IND USBFS_1_USB__ARB_RW1_RA_MSB
  516. #define USBFS_1_ARB_RW1_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_WA)
  517. #define USBFS_1_ARB_RW1_WA_IND USBFS_1_USB__ARB_RW1_WA
  518. #define USBFS_1_ARB_RW1_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW1_WA_MSB)
  519. #define USBFS_1_ARB_RW1_WA_MSB_IND USBFS_1_USB__ARB_RW1_WA_MSB
  520. #define USBFS_1_ARB_RW2_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_DR)
  521. #define USBFS_1_ARB_RW2_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_RA)
  522. #define USBFS_1_ARB_RW2_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_RA_MSB)
  523. #define USBFS_1_ARB_RW2_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_WA)
  524. #define USBFS_1_ARB_RW2_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW2_WA_MSB)
  525. #define USBFS_1_ARB_RW3_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_DR)
  526. #define USBFS_1_ARB_RW3_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_RA)
  527. #define USBFS_1_ARB_RW3_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_RA_MSB)
  528. #define USBFS_1_ARB_RW3_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_WA)
  529. #define USBFS_1_ARB_RW3_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW3_WA_MSB)
  530. #define USBFS_1_ARB_RW4_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_DR)
  531. #define USBFS_1_ARB_RW4_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_RA)
  532. #define USBFS_1_ARB_RW4_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_RA_MSB)
  533. #define USBFS_1_ARB_RW4_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_WA)
  534. #define USBFS_1_ARB_RW4_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW4_WA_MSB)
  535. #define USBFS_1_ARB_RW5_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_DR)
  536. #define USBFS_1_ARB_RW5_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_RA)
  537. #define USBFS_1_ARB_RW5_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_RA_MSB)
  538. #define USBFS_1_ARB_RW5_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_WA)
  539. #define USBFS_1_ARB_RW5_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW5_WA_MSB)
  540. #define USBFS_1_ARB_RW6_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_DR)
  541. #define USBFS_1_ARB_RW6_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_RA)
  542. #define USBFS_1_ARB_RW6_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_RA_MSB)
  543. #define USBFS_1_ARB_RW6_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_WA)
  544. #define USBFS_1_ARB_RW6_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW6_WA_MSB)
  545. #define USBFS_1_ARB_RW7_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_DR)
  546. #define USBFS_1_ARB_RW7_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_RA)
  547. #define USBFS_1_ARB_RW7_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_RA_MSB)
  548. #define USBFS_1_ARB_RW7_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_WA)
  549. #define USBFS_1_ARB_RW7_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW7_WA_MSB)
  550. #define USBFS_1_ARB_RW8_DR_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_DR)
  551. #define USBFS_1_ARB_RW8_RA_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_RA)
  552. #define USBFS_1_ARB_RW8_RA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_RA_MSB)
  553. #define USBFS_1_ARB_RW8_WA_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_WA)
  554. #define USBFS_1_ARB_RW8_WA_MSB_PTR ((reg8 *) USBFS_1_USB__ARB_RW8_WA_MSB)
  555. #define USBFS_1_BUF_SIZE_PTR ( (reg8 *) USBFS_1_USB__BUF_SIZE)
  556. #define USBFS_1_BUF_SIZE_REG (* (reg8 *) USBFS_1_USB__BUF_SIZE)
  557. #define USBFS_1_BUS_RST_CNT_PTR ( (reg8 *) USBFS_1_USB__BUS_RST_CNT)
  558. #define USBFS_1_BUS_RST_CNT_REG (* (reg8 *) USBFS_1_USB__BUS_RST_CNT)
  559. #define USBFS_1_CWA_PTR ( (reg8 *) USBFS_1_USB__CWA)
  560. #define USBFS_1_CWA_REG (* (reg8 *) USBFS_1_USB__CWA)
  561. #define USBFS_1_CWA_MSB_PTR ( (reg8 *) USBFS_1_USB__CWA_MSB)
  562. #define USBFS_1_CWA_MSB_REG (* (reg8 *) USBFS_1_USB__CWA_MSB)
  563. #define USBFS_1_CR0_PTR ( (reg8 *) USBFS_1_USB__CR0)
  564. #define USBFS_1_CR0_REG (* (reg8 *) USBFS_1_USB__CR0)
  565. #define USBFS_1_CR1_PTR ( (reg8 *) USBFS_1_USB__CR1)
  566. #define USBFS_1_CR1_REG (* (reg8 *) USBFS_1_USB__CR1)
  567. #define USBFS_1_DMA_THRES_PTR ( (reg8 *) USBFS_1_USB__DMA_THRES)
  568. #define USBFS_1_DMA_THRES_REG (* (reg8 *) USBFS_1_USB__DMA_THRES)
  569. #define USBFS_1_DMA_THRES_MSB_PTR ( (reg8 *) USBFS_1_USB__DMA_THRES_MSB)
  570. #define USBFS_1_DMA_THRES_MSB_REG (* (reg8 *) USBFS_1_USB__DMA_THRES_MSB)
  571. #define USBFS_1_EP_ACTIVE_PTR ( (reg8 *) USBFS_1_USB__EP_ACTIVE)
  572. #define USBFS_1_EP_ACTIVE_REG (* (reg8 *) USBFS_1_USB__EP_ACTIVE)
  573. #define USBFS_1_EP_TYPE_PTR ( (reg8 *) USBFS_1_USB__EP_TYPE)
  574. #define USBFS_1_EP_TYPE_REG (* (reg8 *) USBFS_1_USB__EP_TYPE)
  575. #define USBFS_1_EP0_CNT_PTR ( (reg8 *) USBFS_1_USB__EP0_CNT)
  576. #define USBFS_1_EP0_CNT_REG (* (reg8 *) USBFS_1_USB__EP0_CNT)
  577. #define USBFS_1_EP0_CR_PTR ( (reg8 *) USBFS_1_USB__EP0_CR)
  578. #define USBFS_1_EP0_CR_REG (* (reg8 *) USBFS_1_USB__EP0_CR)
  579. #define USBFS_1_EP0_DR0_PTR ( (reg8 *) USBFS_1_USB__EP0_DR0)
  580. #define USBFS_1_EP0_DR0_REG (* (reg8 *) USBFS_1_USB__EP0_DR0)
  581. #define USBFS_1_EP0_DR0_IND USBFS_1_USB__EP0_DR0
  582. #define USBFS_1_EP0_DR1_PTR ( (reg8 *) USBFS_1_USB__EP0_DR1)
  583. #define USBFS_1_EP0_DR1_REG (* (reg8 *) USBFS_1_USB__EP0_DR1)
  584. #define USBFS_1_EP0_DR2_PTR ( (reg8 *) USBFS_1_USB__EP0_DR2)
  585. #define USBFS_1_EP0_DR2_REG (* (reg8 *) USBFS_1_USB__EP0_DR2)
  586. #define USBFS_1_EP0_DR3_PTR ( (reg8 *) USBFS_1_USB__EP0_DR3)
  587. #define USBFS_1_EP0_DR3_REG (* (reg8 *) USBFS_1_USB__EP0_DR3)
  588. #define USBFS_1_EP0_DR4_PTR ( (reg8 *) USBFS_1_USB__EP0_DR4)
  589. #define USBFS_1_EP0_DR4_REG (* (reg8 *) USBFS_1_USB__EP0_DR4)
  590. #define USBFS_1_EP0_DR5_PTR ( (reg8 *) USBFS_1_USB__EP0_DR5)
  591. #define USBFS_1_EP0_DR5_REG (* (reg8 *) USBFS_1_USB__EP0_DR5)
  592. #define USBFS_1_EP0_DR6_PTR ( (reg8 *) USBFS_1_USB__EP0_DR6)
  593. #define USBFS_1_EP0_DR6_REG (* (reg8 *) USBFS_1_USB__EP0_DR6)
  594. #define USBFS_1_EP0_DR7_PTR ( (reg8 *) USBFS_1_USB__EP0_DR7)
  595. #define USBFS_1_EP0_DR7_REG (* (reg8 *) USBFS_1_USB__EP0_DR7)
  596. #define USBFS_1_OSCLK_DR0_PTR ( (reg8 *) USBFS_1_USB__OSCLK_DR0)
  597. #define USBFS_1_OSCLK_DR0_REG (* (reg8 *) USBFS_1_USB__OSCLK_DR0)
  598. #define USBFS_1_OSCLK_DR1_PTR ( (reg8 *) USBFS_1_USB__OSCLK_DR1)
  599. #define USBFS_1_OSCLK_DR1_REG (* (reg8 *) USBFS_1_USB__OSCLK_DR1)
  600. #define USBFS_1_PM_ACT_CFG_PTR ( (reg8 *) USBFS_1_USB__PM_ACT_CFG)
  601. #define USBFS_1_PM_ACT_CFG_REG (* (reg8 *) USBFS_1_USB__PM_ACT_CFG)
  602. #define USBFS_1_PM_STBY_CFG_PTR ( (reg8 *) USBFS_1_USB__PM_STBY_CFG)
  603. #define USBFS_1_PM_STBY_CFG_REG (* (reg8 *) USBFS_1_USB__PM_STBY_CFG)
  604. #define USBFS_1_SIE_EP_INT_EN_PTR ( (reg8 *) USBFS_1_USB__SIE_EP_INT_EN)
  605. #define USBFS_1_SIE_EP_INT_EN_REG (* (reg8 *) USBFS_1_USB__SIE_EP_INT_EN)
  606. #define USBFS_1_SIE_EP_INT_SR_PTR ( (reg8 *) USBFS_1_USB__SIE_EP_INT_SR)
  607. #define USBFS_1_SIE_EP_INT_SR_REG (* (reg8 *) USBFS_1_USB__SIE_EP_INT_SR)
  608. #define USBFS_1_SIE_EP1_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP1_CNT0)
  609. #define USBFS_1_SIE_EP1_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP1_CNT0)
  610. #define USBFS_1_SIE_EP1_CNT0_IND USBFS_1_USB__SIE_EP1_CNT0
  611. #define USBFS_1_SIE_EP1_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP1_CNT1)
  612. #define USBFS_1_SIE_EP1_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP1_CNT1)
  613. #define USBFS_1_SIE_EP1_CNT1_IND USBFS_1_USB__SIE_EP1_CNT1
  614. #define USBFS_1_SIE_EP1_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP1_CR0)
  615. #define USBFS_1_SIE_EP1_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP1_CR0)
  616. #define USBFS_1_SIE_EP1_CR0_IND USBFS_1_USB__SIE_EP1_CR0
  617. #define USBFS_1_SIE_EP2_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP2_CNT0)
  618. #define USBFS_1_SIE_EP2_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP2_CNT0)
  619. #define USBFS_1_SIE_EP2_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP2_CNT1)
  620. #define USBFS_1_SIE_EP2_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP2_CNT1)
  621. #define USBFS_1_SIE_EP2_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP2_CR0)
  622. #define USBFS_1_SIE_EP2_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP2_CR0)
  623. #define USBFS_1_SIE_EP3_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP3_CNT0)
  624. #define USBFS_1_SIE_EP3_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP3_CNT0)
  625. #define USBFS_1_SIE_EP3_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP3_CNT1)
  626. #define USBFS_1_SIE_EP3_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP3_CNT1)
  627. #define USBFS_1_SIE_EP3_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP3_CR0)
  628. #define USBFS_1_SIE_EP3_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP3_CR0)
  629. #define USBFS_1_SIE_EP4_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP4_CNT0)
  630. #define USBFS_1_SIE_EP4_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP4_CNT0)
  631. #define USBFS_1_SIE_EP4_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP4_CNT1)
  632. #define USBFS_1_SIE_EP4_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP4_CNT1)
  633. #define USBFS_1_SIE_EP4_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP4_CR0)
  634. #define USBFS_1_SIE_EP4_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP4_CR0)
  635. #define USBFS_1_SIE_EP5_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP5_CNT0)
  636. #define USBFS_1_SIE_EP5_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP5_CNT0)
  637. #define USBFS_1_SIE_EP5_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP5_CNT1)
  638. #define USBFS_1_SIE_EP5_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP5_CNT1)
  639. #define USBFS_1_SIE_EP5_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP5_CR0)
  640. #define USBFS_1_SIE_EP5_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP5_CR0)
  641. #define USBFS_1_SIE_EP6_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP6_CNT0)
  642. #define USBFS_1_SIE_EP6_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP6_CNT0)
  643. #define USBFS_1_SIE_EP6_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP6_CNT1)
  644. #define USBFS_1_SIE_EP6_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP6_CNT1)
  645. #define USBFS_1_SIE_EP6_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP6_CR0)
  646. #define USBFS_1_SIE_EP6_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP6_CR0)
  647. #define USBFS_1_SIE_EP7_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP7_CNT0)
  648. #define USBFS_1_SIE_EP7_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP7_CNT0)
  649. #define USBFS_1_SIE_EP7_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP7_CNT1)
  650. #define USBFS_1_SIE_EP7_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP7_CNT1)
  651. #define USBFS_1_SIE_EP7_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP7_CR0)
  652. #define USBFS_1_SIE_EP7_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP7_CR0)
  653. #define USBFS_1_SIE_EP8_CNT0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP8_CNT0)
  654. #define USBFS_1_SIE_EP8_CNT0_REG (* (reg8 *) USBFS_1_USB__SIE_EP8_CNT0)
  655. #define USBFS_1_SIE_EP8_CNT1_PTR ( (reg8 *) USBFS_1_USB__SIE_EP8_CNT1)
  656. #define USBFS_1_SIE_EP8_CNT1_REG (* (reg8 *) USBFS_1_USB__SIE_EP8_CNT1)
  657. #define USBFS_1_SIE_EP8_CR0_PTR ( (reg8 *) USBFS_1_USB__SIE_EP8_CR0)
  658. #define USBFS_1_SIE_EP8_CR0_REG (* (reg8 *) USBFS_1_USB__SIE_EP8_CR0)
  659. #define USBFS_1_SOF0_PTR ( (reg8 *) USBFS_1_USB__SOF0)
  660. #define USBFS_1_SOF0_REG (* (reg8 *) USBFS_1_USB__SOF0)
  661. #define USBFS_1_SOF1_PTR ( (reg8 *) USBFS_1_USB__SOF1)
  662. #define USBFS_1_SOF1_REG (* (reg8 *) USBFS_1_USB__SOF1)
  663. #define USBFS_1_USB_CLK_EN_PTR ( (reg8 *) USBFS_1_USB__USB_CLK_EN)
  664. #define USBFS_1_USB_CLK_EN_REG (* (reg8 *) USBFS_1_USB__USB_CLK_EN)
  665. #define USBFS_1_USBIO_CR0_PTR ( (reg8 *) USBFS_1_USB__USBIO_CR0)
  666. #define USBFS_1_USBIO_CR0_REG (* (reg8 *) USBFS_1_USB__USBIO_CR0)
  667. #define USBFS_1_USBIO_CR1_PTR ( (reg8 *) USBFS_1_USB__USBIO_CR1)
  668. #define USBFS_1_USBIO_CR1_REG (* (reg8 *) USBFS_1_USB__USBIO_CR1)
  669. #if(!CY_PSOC5LP)
  670. #define USBFS_1_USBIO_CR2_PTR ( (reg8 *) USBFS_1_USB__USBIO_CR2)
  671. #define USBFS_1_USBIO_CR2_REG (* (reg8 *) USBFS_1_USB__USBIO_CR2)
  672. #endif /* End CY_PSOC5LP */
  673. #define USBFS_1_DIE_ID CYDEV_FLSHID_CUST_TABLES_BASE
  674. #define USBFS_1_PM_USB_CR0_PTR ( (reg8 *) CYREG_PM_USB_CR0)
  675. #define USBFS_1_PM_USB_CR0_REG (* (reg8 *) CYREG_PM_USB_CR0)
  676. #define USBFS_1_DYN_RECONFIG_PTR ( (reg8 *) USBFS_1_USB__DYN_RECONFIG)
  677. #define USBFS_1_DYN_RECONFIG_REG (* (reg8 *) USBFS_1_USB__DYN_RECONFIG)
  678. #define USBFS_1_DM_INP_DIS_PTR ( (reg8 *) USBFS_1_Dm__INP_DIS)
  679. #define USBFS_1_DM_INP_DIS_REG (* (reg8 *) USBFS_1_Dm__INP_DIS)
  680. #define USBFS_1_DP_INP_DIS_PTR ( (reg8 *) USBFS_1_Dp__INP_DIS)
  681. #define USBFS_1_DP_INP_DIS_REG (* (reg8 *) USBFS_1_Dp__INP_DIS)
  682. #define USBFS_1_DP_INTSTAT_PTR ( (reg8 *) USBFS_1_Dp__INTSTAT)
  683. #define USBFS_1_DP_INTSTAT_REG (* (reg8 *) USBFS_1_Dp__INTSTAT)
  684. #if (USBFS_1_MON_VBUS == 1u)
  685. #if (USBFS_1_EXTERN_VBUS == 0u)
  686. #define USBFS_1_VBUS_DR_PTR ( (reg8 *) USBFS_1_VBUS__DR)
  687. #define USBFS_1_VBUS_DR_REG (* (reg8 *) USBFS_1_VBUS__DR)
  688. #define USBFS_1_VBUS_PS_PTR ( (reg8 *) USBFS_1_VBUS__PS)
  689. #define USBFS_1_VBUS_PS_REG (* (reg8 *) USBFS_1_VBUS__PS)
  690. #define USBFS_1_VBUS_MASK USBFS_1_VBUS__MASK
  691. #else
  692. #define USBFS_1_VBUS_PS_PTR ( (reg8 *) USBFS_1_Vbus_ps_sts_sts_reg__STATUS_REG )
  693. #define USBFS_1_VBUS_MASK (0x01u)
  694. #endif /* End USBFS_1_EXTERN_VBUS == 0u */
  695. #endif /* End USBFS_1_MON_VBUS */
  696. /* Renamed Registers for backward compatibility.
  697. * Should not be used in new designs.
  698. */
  699. #define USBFS_1_ARB_CFG USBFS_1_ARB_CFG_PTR
  700. #define USBFS_1_ARB_EP1_CFG USBFS_1_ARB_EP1_CFG_PTR
  701. #define USBFS_1_ARB_EP1_INT_EN USBFS_1_ARB_EP1_INT_EN_PTR
  702. #define USBFS_1_ARB_EP1_SR USBFS_1_ARB_EP1_SR_PTR
  703. #define USBFS_1_ARB_EP2_CFG USBFS_1_ARB_EP2_CFG_PTR
  704. #define USBFS_1_ARB_EP2_INT_EN USBFS_1_ARB_EP2_INT_EN_PTR
  705. #define USBFS_1_ARB_EP2_SR USBFS_1_ARB_EP2_SR_PTR
  706. #define USBFS_1_ARB_EP3_CFG USBFS_1_ARB_EP3_CFG_PTR
  707. #define USBFS_1_ARB_EP3_INT_EN USBFS_1_ARB_EP3_INT_EN_PTR
  708. #define USBFS_1_ARB_EP3_SR USBFS_1_ARB_EP3_SR_PTR
  709. #define USBFS_1_ARB_EP4_CFG USBFS_1_ARB_EP4_CFG_PTR
  710. #define USBFS_1_ARB_EP4_INT_EN USBFS_1_ARB_EP4_INT_EN_PTR
  711. #define USBFS_1_ARB_EP4_SR USBFS_1_ARB_EP4_SR_PTR
  712. #define USBFS_1_ARB_EP5_CFG USBFS_1_ARB_EP5_CFG_PTR
  713. #define USBFS_1_ARB_EP5_INT_EN USBFS_1_ARB_EP5_INT_EN_PTR
  714. #define USBFS_1_ARB_EP5_SR USBFS_1_ARB_EP5_SR_PTR
  715. #define USBFS_1_ARB_EP6_CFG USBFS_1_ARB_EP6_CFG_PTR
  716. #define USBFS_1_ARB_EP6_INT_EN USBFS_1_ARB_EP6_INT_EN_PTR
  717. #define USBFS_1_ARB_EP6_SR USBFS_1_ARB_EP6_SR_PTR
  718. #define USBFS_1_ARB_EP7_CFG USBFS_1_ARB_EP7_CFG_PTR
  719. #define USBFS_1_ARB_EP7_INT_EN USBFS_1_ARB_EP7_INT_EN_PTR
  720. #define USBFS_1_ARB_EP7_SR USBFS_1_ARB_EP7_SR_PTR
  721. #define USBFS_1_ARB_EP8_CFG USBFS_1_ARB_EP8_CFG_PTR
  722. #define USBFS_1_ARB_EP8_INT_EN USBFS_1_ARB_EP8_INT_EN_PTR
  723. #define USBFS_1_ARB_EP8_SR USBFS_1_ARB_EP8_SR_PTR
  724. #define USBFS_1_ARB_INT_EN USBFS_1_ARB_INT_EN_PTR
  725. #define USBFS_1_ARB_INT_SR USBFS_1_ARB_INT_SR_PTR
  726. #define USBFS_1_ARB_RW1_DR USBFS_1_ARB_RW1_DR_PTR
  727. #define USBFS_1_ARB_RW1_RA USBFS_1_ARB_RW1_RA_PTR
  728. #define USBFS_1_ARB_RW1_RA_MSB USBFS_1_ARB_RW1_RA_MSB_PTR
  729. #define USBFS_1_ARB_RW1_WA USBFS_1_ARB_RW1_WA_PTR
  730. #define USBFS_1_ARB_RW1_WA_MSB USBFS_1_ARB_RW1_WA_MSB_PTR
  731. #define USBFS_1_ARB_RW2_DR USBFS_1_ARB_RW2_DR_PTR
  732. #define USBFS_1_ARB_RW2_RA USBFS_1_ARB_RW2_RA_PTR
  733. #define USBFS_1_ARB_RW2_RA_MSB USBFS_1_ARB_RW2_RA_MSB_PTR
  734. #define USBFS_1_ARB_RW2_WA USBFS_1_ARB_RW2_WA_PTR
  735. #define USBFS_1_ARB_RW2_WA_MSB USBFS_1_ARB_RW2_WA_MSB_PTR
  736. #define USBFS_1_ARB_RW3_DR USBFS_1_ARB_RW3_DR_PTR
  737. #define USBFS_1_ARB_RW3_RA USBFS_1_ARB_RW3_RA_PTR
  738. #define USBFS_1_ARB_RW3_RA_MSB USBFS_1_ARB_RW3_RA_MSB_PTR
  739. #define USBFS_1_ARB_RW3_WA USBFS_1_ARB_RW3_WA_PTR
  740. #define USBFS_1_ARB_RW3_WA_MSB USBFS_1_ARB_RW3_WA_MSB_PTR
  741. #define USBFS_1_ARB_RW4_DR USBFS_1_ARB_RW4_DR_PTR
  742. #define USBFS_1_ARB_RW4_RA USBFS_1_ARB_RW4_RA_PTR
  743. #define USBFS_1_ARB_RW4_RA_MSB USBFS_1_ARB_RW4_RA_MSB_PTR
  744. #define USBFS_1_ARB_RW4_WA USBFS_1_ARB_RW4_WA_PTR
  745. #define USBFS_1_ARB_RW4_WA_MSB USBFS_1_ARB_RW4_WA_MSB_PTR
  746. #define USBFS_1_ARB_RW5_DR USBFS_1_ARB_RW5_DR_PTR
  747. #define USBFS_1_ARB_RW5_RA USBFS_1_ARB_RW5_RA_PTR
  748. #define USBFS_1_ARB_RW5_RA_MSB USBFS_1_ARB_RW5_RA_MSB_PTR
  749. #define USBFS_1_ARB_RW5_WA USBFS_1_ARB_RW5_WA_PTR
  750. #define USBFS_1_ARB_RW5_WA_MSB USBFS_1_ARB_RW5_WA_MSB_PTR
  751. #define USBFS_1_ARB_RW6_DR USBFS_1_ARB_RW6_DR_PTR
  752. #define USBFS_1_ARB_RW6_RA USBFS_1_ARB_RW6_RA_PTR
  753. #define USBFS_1_ARB_RW6_RA_MSB USBFS_1_ARB_RW6_RA_MSB_PTR
  754. #define USBFS_1_ARB_RW6_WA USBFS_1_ARB_RW6_WA_PTR
  755. #define USBFS_1_ARB_RW6_WA_MSB USBFS_1_ARB_RW6_WA_MSB_PTR
  756. #define USBFS_1_ARB_RW7_DR USBFS_1_ARB_RW7_DR_PTR
  757. #define USBFS_1_ARB_RW7_RA USBFS_1_ARB_RW7_RA_PTR
  758. #define USBFS_1_ARB_RW7_RA_MSB USBFS_1_ARB_RW7_RA_MSB_PTR
  759. #define USBFS_1_ARB_RW7_WA USBFS_1_ARB_RW7_WA_PTR
  760. #define USBFS_1_ARB_RW7_WA_MSB USBFS_1_ARB_RW7_WA_MSB_PTR
  761. #define USBFS_1_ARB_RW8_DR USBFS_1_ARB_RW8_DR_PTR
  762. #define USBFS_1_ARB_RW8_RA USBFS_1_ARB_RW8_RA_PTR
  763. #define USBFS_1_ARB_RW8_RA_MSB USBFS_1_ARB_RW8_RA_MSB_PTR
  764. #define USBFS_1_ARB_RW8_WA USBFS_1_ARB_RW8_WA_PTR
  765. #define USBFS_1_ARB_RW8_WA_MSB USBFS_1_ARB_RW8_WA_MSB_PTR
  766. #define USBFS_1_BUF_SIZE USBFS_1_BUF_SIZE_PTR
  767. #define USBFS_1_BUS_RST_CNT USBFS_1_BUS_RST_CNT_PTR
  768. #define USBFS_1_CR0 USBFS_1_CR0_PTR
  769. #define USBFS_1_CR1 USBFS_1_CR1_PTR
  770. #define USBFS_1_CWA USBFS_1_CWA_PTR
  771. #define USBFS_1_CWA_MSB USBFS_1_CWA_MSB_PTR
  772. #define USBFS_1_DMA_THRES USBFS_1_DMA_THRES_PTR
  773. #define USBFS_1_DMA_THRES_MSB USBFS_1_DMA_THRES_MSB_PTR
  774. #define USBFS_1_EP_ACTIVE USBFS_1_EP_ACTIVE_PTR
  775. #define USBFS_1_EP_TYPE USBFS_1_EP_TYPE_PTR
  776. #define USBFS_1_EP0_CNT USBFS_1_EP0_CNT_PTR
  777. #define USBFS_1_EP0_CR USBFS_1_EP0_CR_PTR
  778. #define USBFS_1_EP0_DR0 USBFS_1_EP0_DR0_PTR
  779. #define USBFS_1_EP0_DR1 USBFS_1_EP0_DR1_PTR
  780. #define USBFS_1_EP0_DR2 USBFS_1_EP0_DR2_PTR
  781. #define USBFS_1_EP0_DR3 USBFS_1_EP0_DR3_PTR
  782. #define USBFS_1_EP0_DR4 USBFS_1_EP0_DR4_PTR
  783. #define USBFS_1_EP0_DR5 USBFS_1_EP0_DR5_PTR
  784. #define USBFS_1_EP0_DR6 USBFS_1_EP0_DR6_PTR
  785. #define USBFS_1_EP0_DR7 USBFS_1_EP0_DR7_PTR
  786. #define USBFS_1_OSCLK_DR0 USBFS_1_OSCLK_DR0_PTR
  787. #define USBFS_1_OSCLK_DR1 USBFS_1_OSCLK_DR1_PTR
  788. #define USBFS_1_PM_ACT_CFG USBFS_1_PM_ACT_CFG_PTR
  789. #define USBFS_1_PM_STBY_CFG USBFS_1_PM_STBY_CFG_PTR
  790. #define USBFS_1_SIE_EP_INT_EN USBFS_1_SIE_EP_INT_EN_PTR
  791. #define USBFS_1_SIE_EP_INT_SR USBFS_1_SIE_EP_INT_SR_PTR
  792. #define USBFS_1_SIE_EP1_CNT0 USBFS_1_SIE_EP1_CNT0_PTR
  793. #define USBFS_1_SIE_EP1_CNT1 USBFS_1_SIE_EP1_CNT1_PTR
  794. #define USBFS_1_SIE_EP1_CR0 USBFS_1_SIE_EP1_CR0_PTR
  795. #define USBFS_1_SIE_EP2_CNT0 USBFS_1_SIE_EP2_CNT0_PTR
  796. #define USBFS_1_SIE_EP2_CNT1 USBFS_1_SIE_EP2_CNT1_PTR
  797. #define USBFS_1_SIE_EP2_CR0 USBFS_1_SIE_EP2_CR0_PTR
  798. #define USBFS_1_SIE_EP3_CNT0 USBFS_1_SIE_EP3_CNT0_PTR
  799. #define USBFS_1_SIE_EP3_CNT1 USBFS_1_SIE_EP3_CNT1_PTR
  800. #define USBFS_1_SIE_EP3_CR0 USBFS_1_SIE_EP3_CR0_PTR
  801. #define USBFS_1_SIE_EP4_CNT0 USBFS_1_SIE_EP4_CNT0_PTR
  802. #define USBFS_1_SIE_EP4_CNT1 USBFS_1_SIE_EP4_CNT1_PTR
  803. #define USBFS_1_SIE_EP4_CR0 USBFS_1_SIE_EP4_CR0_PTR
  804. #define USBFS_1_SIE_EP5_CNT0 USBFS_1_SIE_EP5_CNT0_PTR
  805. #define USBFS_1_SIE_EP5_CNT1 USBFS_1_SIE_EP5_CNT1_PTR
  806. #define USBFS_1_SIE_EP5_CR0 USBFS_1_SIE_EP5_CR0_PTR
  807. #define USBFS_1_SIE_EP6_CNT0 USBFS_1_SIE_EP6_CNT0_PTR
  808. #define USBFS_1_SIE_EP6_CNT1 USBFS_1_SIE_EP6_CNT1_PTR
  809. #define USBFS_1_SIE_EP6_CR0 USBFS_1_SIE_EP6_CR0_PTR
  810. #define USBFS_1_SIE_EP7_CNT0 USBFS_1_SIE_EP7_CNT0_PTR
  811. #define USBFS_1_SIE_EP7_CNT1 USBFS_1_SIE_EP7_CNT1_PTR
  812. #define USBFS_1_SIE_EP7_CR0 USBFS_1_SIE_EP7_CR0_PTR
  813. #define USBFS_1_SIE_EP8_CNT0 USBFS_1_SIE_EP8_CNT0_PTR
  814. #define USBFS_1_SIE_EP8_CNT1 USBFS_1_SIE_EP8_CNT1_PTR
  815. #define USBFS_1_SIE_EP8_CR0 USBFS_1_SIE_EP8_CR0_PTR
  816. #define USBFS_1_SOF0 USBFS_1_SOF0_PTR
  817. #define USBFS_1_SOF1 USBFS_1_SOF1_PTR
  818. #define USBFS_1_USB_CLK_EN USBFS_1_USB_CLK_EN_PTR
  819. #define USBFS_1_USBIO_CR0 USBFS_1_USBIO_CR0_PTR
  820. #define USBFS_1_USBIO_CR1 USBFS_1_USBIO_CR1_PTR
  821. #define USBFS_1_USBIO_CR2 USBFS_1_USBIO_CR2_PTR
  822. #define USBFS_1_USB_MEM ((reg8 *) CYDEV_USB_MEM_BASE)
  823. #if(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_LEOPARD)
  824. /* PSoC3 interrupt registers*/
  825. #define USBFS_1_USB_ISR_PRIOR ((reg8 *) CYDEV_INTC_PRIOR0)
  826. #define USBFS_1_USB_ISR_SET_EN ((reg8 *) CYDEV_INTC_SET_EN0)
  827. #define USBFS_1_USB_ISR_CLR_EN ((reg8 *) CYDEV_INTC_CLR_EN0)
  828. #define USBFS_1_USB_ISR_VECT ((cyisraddress *) CYDEV_INTC_VECT_MBASE)
  829. #elif(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_PANTHER)
  830. /* PSoC5 interrupt registers*/
  831. #define USBFS_1_USB_ISR_PRIOR ((reg8 *) CYDEV_NVIC_PRI_0)
  832. #define USBFS_1_USB_ISR_SET_EN ((reg8 *) CYDEV_NVIC_SETENA0)
  833. #define USBFS_1_USB_ISR_CLR_EN ((reg8 *) CYDEV_NVIC_CLRENA0)
  834. #define USBFS_1_USB_ISR_VECT ((cyisraddress *) CYDEV_NVIC_VECT_OFFSET)
  835. #endif /* End CYDEV_CHIP_DIE_EXPECT */
  836. /***************************************
  837. * Interrupt vectors, masks and priorities
  838. ***************************************/
  839. #define USBFS_1_BUS_RESET_PRIOR USBFS_1_bus_reset__INTC_PRIOR_NUM
  840. #define USBFS_1_BUS_RESET_MASK USBFS_1_bus_reset__INTC_MASK
  841. #define USBFS_1_BUS_RESET_VECT_NUM USBFS_1_bus_reset__INTC_NUMBER
  842. #define USBFS_1_SOF_PRIOR USBFS_1_sof_int__INTC_PRIOR_NUM
  843. #define USBFS_1_SOF_MASK USBFS_1_sof_int__INTC_MASK
  844. #define USBFS_1_SOF_VECT_NUM USBFS_1_sof_int__INTC_NUMBER
  845. #define USBFS_1_EP_0_PRIOR USBFS_1_ep_0__INTC_PRIOR_NUM
  846. #define USBFS_1_EP_0_MASK USBFS_1_ep_0__INTC_MASK
  847. #define USBFS_1_EP_0_VECT_NUM USBFS_1_ep_0__INTC_NUMBER
  848. #define USBFS_1_EP_1_PRIOR USBFS_1_ep_1__INTC_PRIOR_NUM
  849. #define USBFS_1_EP_1_MASK USBFS_1_ep_1__INTC_MASK
  850. #define USBFS_1_EP_1_VECT_NUM USBFS_1_ep_1__INTC_NUMBER
  851. #define USBFS_1_EP_2_PRIOR USBFS_1_ep_2__INTC_PRIOR_NUM
  852. #define USBFS_1_EP_2_MASK USBFS_1_ep_2__INTC_MASK
  853. #define USBFS_1_EP_2_VECT_NUM USBFS_1_ep_2__INTC_NUMBER
  854. #define USBFS_1_EP_3_PRIOR USBFS_1_ep_3__INTC_PRIOR_NUM
  855. #define USBFS_1_EP_3_MASK USBFS_1_ep_3__INTC_MASK
  856. #define USBFS_1_EP_3_VECT_NUM USBFS_1_ep_3__INTC_NUMBER
  857. #define USBFS_1_EP_4_PRIOR USBFS_1_ep_4__INTC_PRIOR_NUM
  858. #define USBFS_1_EP_4_MASK USBFS_1_ep_4__INTC_MASK
  859. #define USBFS_1_EP_4_VECT_NUM USBFS_1_ep_4__INTC_NUMBER
  860. #define USBFS_1_EP_5_PRIOR USBFS_1_ep_5__INTC_PRIOR_NUM
  861. #define USBFS_1_EP_5_MASK USBFS_1_ep_5__INTC_MASK
  862. #define USBFS_1_EP_5_VECT_NUM USBFS_1_ep_5__INTC_NUMBER
  863. #define USBFS_1_EP_6_PRIOR USBFS_1_ep_6__INTC_PRIOR_NUM
  864. #define USBFS_1_EP_6_MASK USBFS_1_ep_6__INTC_MASK
  865. #define USBFS_1_EP_6_VECT_NUM USBFS_1_ep_6__INTC_NUMBER
  866. #define USBFS_1_EP_7_PRIOR USBFS_1_ep_7__INTC_PRIOR_NUM
  867. #define USBFS_1_EP_7_MASK USBFS_1_ep_7__INTC_MASK
  868. #define USBFS_1_EP_7_VECT_NUM USBFS_1_ep_7__INTC_NUMBER
  869. #define USBFS_1_EP_8_PRIOR USBFS_1_ep_8__INTC_PRIOR_NUM
  870. #define USBFS_1_EP_8_MASK USBFS_1_ep_8__INTC_MASK
  871. #define USBFS_1_EP_8_VECT_NUM USBFS_1_ep_8__INTC_NUMBER
  872. #define USBFS_1_DP_INTC_PRIOR USBFS_1_dp_int__INTC_PRIOR_NUM
  873. #define USBFS_1_DP_INTC_MASK USBFS_1_dp_int__INTC_MASK
  874. #define USBFS_1_DP_INTC_VECT_NUM USBFS_1_dp_int__INTC_NUMBER
  875. /* ARB ISR should have higher priority from EP_X ISR, therefore it is defined to highest (0) */
  876. #define USBFS_1_ARB_PRIOR (0u)
  877. #define USBFS_1_ARB_MASK USBFS_1_arb_int__INTC_MASK
  878. #define USBFS_1_ARB_VECT_NUM USBFS_1_arb_int__INTC_NUMBER
  879. /***************************************
  880. * Endpoint 0 offsets (Table 9-2)
  881. **************************************/
  882. #define USBFS_1_bmRequestType USBFS_1_EP0_DR0_PTR
  883. #define USBFS_1_bRequest USBFS_1_EP0_DR1_PTR
  884. #define USBFS_1_wValue USBFS_1_EP0_DR2_PTR
  885. #define USBFS_1_wValueHi USBFS_1_EP0_DR3_PTR
  886. #define USBFS_1_wValueLo USBFS_1_EP0_DR2_PTR
  887. #define USBFS_1_wIndex USBFS_1_EP0_DR4_PTR
  888. #define USBFS_1_wIndexHi USBFS_1_EP0_DR5_PTR
  889. #define USBFS_1_wIndexLo USBFS_1_EP0_DR4_PTR
  890. #define USBFS_1_length USBFS_1_EP0_DR6_PTR
  891. #define USBFS_1_lengthHi USBFS_1_EP0_DR7_PTR
  892. #define USBFS_1_lengthLo USBFS_1_EP0_DR6_PTR
  893. /***************************************
  894. * Register Constants
  895. ***************************************/
  896. #define USBFS_1_VDDD_MV CYDEV_VDDD_MV
  897. #define USBFS_1_3500MV (3500u)
  898. #define USBFS_1_CR1_REG_ENABLE (0x01u)
  899. #define USBFS_1_CR1_ENABLE_LOCK (0x02u)
  900. #define USBFS_1_CR1_BUS_ACTIVITY_SHIFT (0x02u)
  901. #define USBFS_1_CR1_BUS_ACTIVITY ((uint8)(0x01u << USBFS_1_CR1_BUS_ACTIVITY_SHIFT))
  902. #define USBFS_1_CR1_TRIM_MSB_EN (0x08u)
  903. #define USBFS_1_EP0_CNT_DATA_TOGGLE (0x80u)
  904. #define USBFS_1_EPX_CNT_DATA_TOGGLE (0x80u)
  905. #define USBFS_1_EPX_CNT0_MASK (0x0Fu)
  906. #define USBFS_1_EPX_CNTX_MSB_MASK (0x07u)
  907. #define USBFS_1_EPX_CNTX_ADDR_SHIFT (0x04u)
  908. #define USBFS_1_EPX_CNTX_ADDR_OFFSET (0x10u)
  909. #define USBFS_1_EPX_CNTX_CRC_COUNT (0x02u)
  910. #define USBFS_1_EPX_DATA_BUF_MAX (512u)
  911. #define USBFS_1_CR0_ENABLE (0x80u)
  912. /* A 100 KHz clock is used for BUS reset count. Recommended is to count 10 pulses */
  913. #define USBFS_1_BUS_RST_COUNT (0x0au)
  914. #define USBFS_1_USBIO_CR1_IOMODE (0x20u)
  915. #define USBFS_1_USBIO_CR1_USBPUEN (0x04u)
  916. #define USBFS_1_USBIO_CR1_DP0 (0x02u)
  917. #define USBFS_1_USBIO_CR1_DM0 (0x01u)
  918. #define USBFS_1_USBIO_CR0_TEN (0x80u)
  919. #define USBFS_1_USBIO_CR0_TSE0 (0x40u)
  920. #define USBFS_1_USBIO_CR0_TD (0x20u)
  921. #define USBFS_1_USBIO_CR0_RD (0x01u)
  922. #define USBFS_1_FASTCLK_IMO_CR_USBCLK_ON (0x40u)
  923. #define USBFS_1_FASTCLK_IMO_CR_XCLKEN (0x20u)
  924. #define USBFS_1_FASTCLK_IMO_CR_FX2ON (0x10u)
  925. #define USBFS_1_ARB_EPX_CFG_RESET (0x08u)
  926. #define USBFS_1_ARB_EPX_CFG_CRC_BYPASS (0x04u)
  927. #define USBFS_1_ARB_EPX_CFG_DMA_REQ (0x02u)
  928. #define USBFS_1_ARB_EPX_CFG_IN_DATA_RDY (0x01u)
  929. #define USBFS_1_ARB_EPX_SR_IN_BUF_FULL (0x01u)
  930. #define USBFS_1_ARB_EPX_SR_DMA_GNT (0x02u)
  931. #define USBFS_1_ARB_EPX_SR_BUF_OVER (0x04u)
  932. #define USBFS_1_ARB_EPX_SR_BUF_UNDER (0x08u)
  933. #define USBFS_1_ARB_CFG_AUTO_MEM (0x10u)
  934. #define USBFS_1_ARB_CFG_MANUAL_DMA (0x20u)
  935. #define USBFS_1_ARB_CFG_AUTO_DMA (0x40u)
  936. #define USBFS_1_ARB_CFG_CFG_CPM (0x80u)
  937. #if(USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO)
  938. #define USBFS_1_ARB_EPX_INT_MASK (0x1Du)
  939. #else
  940. #define USBFS_1_ARB_EPX_INT_MASK (0x1Fu)
  941. #endif /* End USBFS_1_EP_MM == USBFS_1__EP_DMAAUTO */
  942. #define USBFS_1_ARB_INT_MASK (uint8)((USBFS_1_DMA1_REMOVE ^ 1u) | \
  943. (uint8)((USBFS_1_DMA2_REMOVE ^ 1u) << 1u) | \
  944. (uint8)((USBFS_1_DMA3_REMOVE ^ 1u) << 2u) | \
  945. (uint8)((USBFS_1_DMA4_REMOVE ^ 1u) << 3u) | \
  946. (uint8)((USBFS_1_DMA5_REMOVE ^ 1u) << 4u) | \
  947. (uint8)((USBFS_1_DMA6_REMOVE ^ 1u) << 5u) | \
  948. (uint8)((USBFS_1_DMA7_REMOVE ^ 1u) << 6u) | \
  949. (uint8)((USBFS_1_DMA8_REMOVE ^ 1u) << 7u) )
  950. #define USBFS_1_SIE_EP_INT_EP1_MASK (0x01u)
  951. #define USBFS_1_SIE_EP_INT_EP2_MASK (0x02u)
  952. #define USBFS_1_SIE_EP_INT_EP3_MASK (0x04u)
  953. #define USBFS_1_SIE_EP_INT_EP4_MASK (0x08u)
  954. #define USBFS_1_SIE_EP_INT_EP5_MASK (0x10u)
  955. #define USBFS_1_SIE_EP_INT_EP6_MASK (0x20u)
  956. #define USBFS_1_SIE_EP_INT_EP7_MASK (0x40u)
  957. #define USBFS_1_SIE_EP_INT_EP8_MASK (0x80u)
  958. #define USBFS_1_PM_ACT_EN_FSUSB USBFS_1_USB__PM_ACT_MSK
  959. #define USBFS_1_PM_STBY_EN_FSUSB USBFS_1_USB__PM_STBY_MSK
  960. #define USBFS_1_PM_AVAIL_EN_FSUSBIO (0x10u)
  961. #define USBFS_1_PM_USB_CR0_REF_EN (0x01u)
  962. #define USBFS_1_PM_USB_CR0_PD_N (0x02u)
  963. #define USBFS_1_PM_USB_CR0_PD_PULLUP_N (0x04u)
  964. #define USBFS_1_USB_CLK_ENABLE (0x01u)
  965. #define USBFS_1_DM_MASK USBFS_1_Dm__0__MASK
  966. #define USBFS_1_DP_MASK USBFS_1_Dp__0__MASK
  967. #define USBFS_1_DYN_RECONFIG_ENABLE (0x01u)
  968. #define USBFS_1_DYN_RECONFIG_EP_SHIFT (0x01u)
  969. #define USBFS_1_DYN_RECONFIG_RDY_STS (0x10u)
  970. #endif /* End CY_USBFS_USBFS_1_H */
  971. /* [] END OF FILE */