RT-AICHIP-sample
usbhw.h
[詳解]
1 /*----------------------------------------------------------------------------
2  * U S B - K e r n e l
3  *----------------------------------------------------------------------------
4  * Name: usbhw.h
5  * Purpose: USB Hardware Layer Definitions
6  * Version: V1.20
7  *----------------------------------------------------------------------------
8  * This software is supplied "AS IS" without any warranties, express,
9  * implied or statutory, including but not limited to the implied
10  * warranties of fitness for purpose, satisfactory quality and
11  * noninfringement. Keil extends you a royalty-free right to reproduce
12  * and distribute executable files created using this software for use
13  * on NXP Semiconductors LPC microcontroller devices only. Nothing else
14  * gives you the right to use this software.
15  *
16  * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
17  *----------------------------------------------------------------------------
18  * History:
19  * V1.20 Added USB_ClearEPBuf
20  * V1.00 Initial Version
21  *----------------------------------------------------------------------------*/
22 
23 #ifndef __USBHW_H__
24 #define __USBHW_H__
25 
26 
27 /* USB Error Codes */
28 #define USB_ERR_PID 0x0001 /* PID Error */
29 #define USB_ERR_UEPKT 0x0002 /* Unexpected Packet */
30 #define USB_ERR_DCRC 0x0004 /* Data CRC Error */
31 #define USB_ERR_TIMOUT 0x0008 /* Bus Time-out Error */
32 #define USB_ERR_EOP 0x0010 /* End of Packet Error */
33 #define USB_ERR_B_OVRN 0x0020 /* Buffer Overrun */
34 #define USB_ERR_BTSTF 0x0040 /* Bit Stuff Error */
35 #define USB_ERR_TGL 0x0080 /* Toggle Bit Error */
36 
37 /* USB Hardware Functions */
38 extern void USBIOClkConfig (void);
39 extern void USB_Init (void);
40 extern void USB_Connect (uint32_t con);
41 extern void USB_Reset (void);
42 extern void USB_Suspend (void);
43 extern void USB_Resume (void);
44 extern void USB_WakeUp (void);
45 extern void USB_WakeUpCfg (uint32_t cfg);
46 extern void USB_SetAddress (uint32_t adr);
47 extern void USB_Configure (uint32_t cfg);
48 extern void USB_ConfigEP (USB_ENDPOINT_DESCRIPTOR *pEPD);
49 extern void USB_DirCtrlEP (uint32_t dir);
50 extern void USB_EnableEP (uint32_t EPNum);
51 extern void USB_DisableEP (uint32_t EPNum);
52 extern void USB_ResetEP (uint32_t EPNum);
53 extern void USB_SetStallEP (uint32_t EPNum);
54 extern void USB_ClrStallEP (uint32_t EPNum);
55 extern void USB_ClearEPBuf (uint32_t EPNum);
56 extern uint32_t USB_ReadEP (uint32_t EPNum, uint8_t *pData);
57 extern uint32_t USB_WriteEP (uint32_t EPNum, uint8_t *pData, uint32_t cnt);
58 extern uint32_t USB_GetFrame(void);
59 extern void USB_IRQHandler (void);
60 
61 extern void USB_IRQ (void);
62 
63 #endif /* __USBHW_H__ */
void USB_DisableEP(uint32_t EPNum)
Definition: usbhw.c:325
void USB_Resume(void)
Definition: usbhw.c:227
void USB_Reset(void)
Definition: usbhw.c:198
uint32_t USB_ReadEP(uint32_t EPNum, uint8_t *pData)
Definition: usbhw.c:391
uint32_t USB_GetFrame(void)
Definition: usbhw.c:454
void USB_SetAddress(uint32_t adr)
Definition: usbhw.c:263
void USB_ResetEP(uint32_t EPNum)
Definition: usbhw.c:338
void USB_Init(void)
Definition: usbhw.c:160
void USB_IRQ(void)
Definition: usbhw.c:564
unsigned char uint8_t
Definition: type.h:27
void USB_Suspend(void)
Definition: usbhw.c:216
void USB_Connect(uint32_t con)
Definition: usbhw.c:187
void USBIOClkConfig(void)
Definition: usbhw.c:40
void USB_IRQHandler(void)
Definition: usbhw.c:469
void USB_WakeUpCfg(uint32_t cfg)
Definition: usbhw.c:252
uint32_t USB_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
Definition: usbhw.c:428
void USB_ConfigEP(USB_ENDPOINT_DESCRIPTOR *pEPD)
Definition: usbhw.c:288
void USB_ClrStallEP(uint32_t EPNum)
Definition: usbhw.c:364
void USB_Configure(uint32_t cfg)
Definition: usbhw.c:275
void USB_DirCtrlEP(uint32_t dir)
Definition: usbhw.c:299
void USB_SetStallEP(uint32_t EPNum)
Definition: usbhw.c:351
void USB_WakeUp(void)
Definition: usbhw.c:238
void USB_EnableEP(uint32_t EPNum)
Definition: usbhw.c:312
void USB_ClearEPBuf(uint32_t EPNum)
Definition: usbhw.c:377
unsigned int uint32_t
Definition: type.h:29