From c55d958a2064f647f5491ea9124ad512e755fa1a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 28 Sep 2008 17:15:17 +0000 Subject: [PATCH] Preparing USB environment git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@957 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/include/lpc214x/irq.h | 4 ++-- arch/arm/src/dm320/dm320_usb.h | 1 + arch/arm/src/lpc214x/lpc214x_usbdev.h | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/lpc214x/irq.h b/arch/arm/include/lpc214x/irq.h index 8e389218f8..911f51df90 100644 --- a/arch/arm/include/lpc214x/irq.h +++ b/arch/arm/include/lpc214x/irq.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/lpc214x/irq.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/dm320/dm320_usb.h b/arch/arm/src/dm320/dm320_usb.h index 0e599d3360..bffb0608f0 100644 --- a/arch/arm/src/dm320/dm320_usb.h +++ b/arch/arm/src/dm320/dm320_usb.h @@ -223,6 +223,7 @@ /* TXFIFO2 register bit settings **************************************************/ +#define USB_TXFIF02_SZMASK (0xe0) #define USB_TXFIFO2_SZ_8 (0x00) #define USB_TXFIFO2_SZ_16 (0x20) #define USB_TXFIFO2_SZ_32 (0x40) diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.h b/arch/arm/src/lpc214x/lpc214x_usbdev.h index c98919138e..97ceea9e93 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.h +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.h @@ -47,6 +47,15 @@ * Definitions *******************************************************************************/ +/* PINSEL1 bit definitions for UART0/1: + * + * P0.23 = 01 to enable VBus sense (bits 14-15) + * P0.31 = 10 to enable CONNECT (bits 30-31) + */ + +#define LPC214X_USBDEV_PINSEL (0x80004000) /* PINSEL1 value for USB */ +#define LPC214X_USBDEV_PINMASK (0xc000c000) /* PINSEL1 mask for USB */ + /* USB RAM ********************************************************************/ #define LPC214X_USBDEV_RAMBASE (0x7fd00000) @@ -260,6 +269,16 @@ /* Command Responses ***********************************************************/ +/* EP Select response */ + +#define CMD_USB_EPSELECT_FE (0x01) /* Bit 0=1: IN empty or OUT full */ +#define CMD_USB_EPSELECT_ST (0x02) /* Bit 1=1: Endpoint is stalled */ +#define CMD_USB_EPSELECT_STP (0x04) /* Bit 2=1: Last packet was setup */ +#define CMD_USB_EPSELECT_PO (0x05) /* Bit 3=1: Previous packet was overwritten */ +#define CMD_USB_EPSELECT_EPN (0x10) /* Bit 4=1: NAK sent */ +#define CMD_USB_EPSELECT_B1FULL (0x20) /* Bit 5=1: Buffer 1 full */ +#define CMD_USB_EPSELECT_B2FULL (0x40) /* Bit 6=1: Buffer 2 full */ + /* EP CLRBUFFER response */ #define CMD_USB_CLRBUFFER_PO (0x00000001)