Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef USBD_HAL_H
00031 #define USBD_HAL_H
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #include <stdbool.h>
00048 #include <stdint.h>
00049 #include <stdio.h>
00050
00051 #include "USBD.h"
00052 #include <USBDescriptors.h>
00053 #include <USBRequests.h>
00054
00055
00056
00057
00058
00059
00060 #define bmEP(bEP) (1 << (bEP))
00061
00062 #define EndpointInt (USBHS_DEVISR_PEP_0 | USBHS_DEVISR_PEP_1 | USBHS_DEVISR_PEP_2 | USBHS_DEVISR_PEP_3 |\
00063 USBHS_DEVISR_PEP_4 | USBHS_DEVISR_PEP_5 | USBHS_DEVISR_PEP_6 | USBHS_DEVISR_PEP_7 |\
00064 USBHS_DEVISR_PEP_8 | USBHS_DEVISR_PEP_9 | USBHS_DEVISR_PEP_10 | USBHS_DEVISR_PEP_11 )
00065
00066 #define DMAEndpointInt (USBHS_DEVISR_DMA_1 | USBHS_DEVISR_DMA_2 | USBHS_DEVISR_DMA_3 |\
00067 USBHS_DEVISR_DMA_4 | USBHS_DEVISR_DMA_5 | USBHS_DEVISR_DMA_6 | USBHS_DEVISR_DMA_7 )
00068
00069
00070
00071
00072
00073
00074
00075
00076 extern void USBD_HAL_Init(void);
00077 extern void USBD_HAL_Connect(void);
00078 extern void USBD_HAL_Disconnect(void);
00079
00080 extern void USBD_HAL_RemoteWakeUp(void);
00081 extern void USBD_HAL_SetConfiguration(uint8_t cfgnum);
00082 extern void USBD_HAL_SetAddress(uint8_t address);
00083 extern uint8_t USBD_HAL_IsHighSpeed(void);
00084
00085 extern void USBD_HAL_Suspend(void);
00086 extern void USBD_HAL_Activate(void);
00087 extern void USBD_HAL_WaitReadData(uint8_t bEndpoint);
00088 extern void USBD_HAL_ResetEPs(uint32_t bmEPs,uint8_t bStatus, uint8_t bKeepCfg);
00089 extern void USBD_HAL_CancelIo(uint32_t bmEPs);
00090 extern uint8_t USBD_HAL_ConfigureEP(const USBEndpointDescriptor * pDescriptor);
00091
00092 extern uint8_t USBD_HAL_SetTransferCallback(uint8_t bEP,
00093 TransferCallback fCallback,
00094 void * pCbData);
00095 extern uint8_t USBD_HAL_SetupMblTransfer(uint8_t bEndpoint,
00096 USBDTransferBuffer * pMbList,
00097 uint16_t mblSize,
00098 uint16_t startOffset);
00099 extern uint8_t USBD_HAL_Write(uint8_t bEndpoint,
00100 const void * pData,
00101 uint32_t dLength);
00102 extern uint8_t USBD_HAL_WrWithHdr(uint8_t bEndpoint,
00103 const void * pHdr, uint8_t bHdrLen,
00104 const void * pData, uint32_t dLength);
00105 extern uint8_t USBD_HAL_Read(uint8_t bEndpoint,
00106 void * pData,
00107 uint32_t dLength);
00108 extern uint8_t USBD_HAL_Stall(uint8_t bEP);
00109 extern uint8_t USBD_HAL_Halt(uint8_t bEndpoint,uint8_t ctl);
00110 extern void USBD_HAL_Test(uint8_t bIndex);
00111
00112 void USBD_HAL_DetachUsb(void);
00113 void USBD_HAL_AttachUsb(void);
00114 void USBD_HAL_Disable(void);
00115 void USBD_HAL_Enable(void);
00116
00117
00118 #endif // #define USBD_HAL_H