Initial PIC32 driver -- now is just a badly hacked STM32 USB driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4234 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
3d212cf3d6
commit
3de52617ef
@ -438,7 +438,7 @@ EXTERN int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN void pic32mx_dmainitilaize(void);
|
||||
#endif
|
||||
|
||||
@ -456,7 +456,7 @@ EXTERN void pic32mx_dmainitilaize(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN DMA_HANDLE pic32mx_dmachannel(void);
|
||||
#endif
|
||||
|
||||
@ -473,7 +473,7 @@ EXTERN DMA_HANDLE pic32mx_dmachannel(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN void pic32mx_dmafree(DMA_HANDLE handle);
|
||||
#endif
|
||||
|
||||
@ -485,7 +485,7 @@ EXTERN void pic32mx_dmafree(DMA_HANDLE handle);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN int pic32mx_dmarxsetup(DMA_HANDLE handle,
|
||||
uint32_t control, uint32_t config,
|
||||
uint32_t srcaddr, uint32_t destaddr,
|
||||
@ -500,7 +500,7 @@ EXTERN int pic32mx_dmarxsetup(DMA_HANDLE handle,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN int pic32mx_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg);
|
||||
#endif
|
||||
|
||||
@ -514,7 +514,7 @@ EXTERN int pic32mx_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *ar
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
EXTERN void pic32mx_dmastop(DMA_HANDLE handle);
|
||||
#endif
|
||||
|
||||
@ -526,7 +526,7 @@ EXTERN void pic32mx_dmastop(DMA_HANDLE handle);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
#ifdef CONFIG_DEBUG_DMA
|
||||
EXTERN void pic32mx_dmasample(DMA_HANDLE handle, struct pic32mx_dmaregs_s *regs);
|
||||
#else
|
||||
@ -542,7 +542,7 @@ EXTERN void pic32mx_dmasample(DMA_HANDLE handle, struct pic32mx_dmaregs_s *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_pic32mx_GPDMA
|
||||
#ifdef CONFIG_PIC32MX_DMA
|
||||
#ifdef CONFIG_DEBUG_DMA
|
||||
EXTERN void pic32mx_dmadump(DMA_HANDLE handle, const struct pic32mx_dmaregs_s *regs,
|
||||
const char *msg);
|
||||
@ -551,6 +551,51 @@ EXTERN void pic32mx_dmadump(DMA_HANDLE handle, const struct pic32mx_dmaregs_s *r
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: pic32mx_usbpullup
|
||||
*
|
||||
* Description:
|
||||
* If USB is supported and the board supports a pullup via GPIO (for USB software
|
||||
* connect and disconnect), then the board software must provide stm32_pullup.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this method.
|
||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be
|
||||
* NULL.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_USBDEV
|
||||
EXTERN int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: pic32mx_usbsuspend
|
||||
*
|
||||
* Description:
|
||||
* Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is
|
||||
* used. This function is called whenever the USB enters or leaves suspend mode.
|
||||
* This is an opportunity for the board logic to shutdown clocks, power, etc.
|
||||
* while the USB is suspended.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_USBDEV
|
||||
EXTERN void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_usbattach and pic32mx_usbdetach
|
||||
*
|
||||
* Description:
|
||||
* The USB stack must be notified when the device is attached or detached
|
||||
* by calling one of these functions.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_USBDEV
|
||||
EXTERN void pic32mx_usbattach(void);
|
||||
EXTERN void pic32mx_usbdetach(void);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
3834
arch/mips/src/pic32mx/pic32mx-usbdev.c
Normal file
3834
arch/mips/src/pic32mx/pic32mx-usbdev.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -179,7 +179,7 @@
|
||||
#define USB_INT_UERR (1 << 1) /* Bit 1: USB Error Condition Interrupt */
|
||||
#define USB_INT_SOF (1 << 2) /* Bit 2: SOF Token Interrupt */
|
||||
#define USB_INT_TRN (1 << 3) /* Bit 3: Token Processing Complete Interrupt */
|
||||
#define USB_INT_IDLE (1 << 4) /* Bit 4 : Idle Detect Interrupt */
|
||||
#define USB_INT_IDLE (1 << 4) /* Bit 4: Idle Detect Interrupt */
|
||||
#define USB_INT_RESUME (1 << 5) /* Bit 5: Resume Interrupt */
|
||||
#define USB_INT_ATTACH (1 << 6) /* Bit 6: Peripheral Attach Interrupt */
|
||||
#define USB_INT_STALL (1 << 7) /* Bit 7: STALL Handshake Interrupt */
|
||||
@ -290,12 +290,13 @@
|
||||
/* Buffer Descriptor Table (BDT) ****************************************************/
|
||||
/* Offset 0: On write (software->hardware) */
|
||||
|
||||
#define USB_BDT_BSTALL (1 << 2) /* Bit 2: Buffer Stall Enable bit */
|
||||
#define USB_BDT_DTS (1 << 3) /* Bit 3: Data Toggle Synchronization Enable bit */
|
||||
#define USB_BDT_NINC (1 << 4) /* Bit 4: DMA Address Increment Disable bit */
|
||||
#define USB_BDT_KEEP (1 << 5) /* Bit 5: BD Keep Enable bit */
|
||||
#define USB_BDT_DATA01 (1 << 6) /* Bit 6: Data Toggle Packet bit */
|
||||
#define USB_BDT_UOWN (1 << 7) /* Bit 7: USB Own bit */
|
||||
#define USB_BDT_STATUS_MASK 0xfc /* Bits 2-7: Status bits */
|
||||
#define USB_BDT_BSTALL (1 << 2) /* Bit 2: Buffer Stall Enable bit */
|
||||
#define USB_BDT_DTS (1 << 3) /* Bit 3: Data Toggle Synchronization Enable bit */
|
||||
#define USB_BDT_NINC (1 << 4) /* Bit 4: DMA Address Increment Disable bit */
|
||||
#define USB_BDT_KEEP (1 << 5) /* Bit 5: BD Keep Enable bit */
|
||||
#define USB_BDT_DATA01 (1 << 6) /* Bit 6: Data Toggle Packet bit */
|
||||
#define USB_BDT_UOWN (1 << 7) /* Bit 7: USB Own bit */
|
||||
#define USB_BDT_BYTECOUNT_SHIFT (16) /* Bits 16-25: Byte Count bits */
|
||||
#define USB_BDT_BYTECOUNT_MASK (0x3ff << USB_BDT_BYTECOUNT_SHIFT)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user