summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-25 16:22:07 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-03-25 16:22:07 +0000
commit9cca35ff9bc8b9985aba67f2f39b4309b5e44c8e (patch)
treee44bc6df4202982ebde98dbfcb76401aa8c82515
parentdac9280da1557443ff9eff12105479ea43c241f7 (diff)
downloadnuttx-9cca35ff9bc8b9985aba67f2f39b4309b5e44c8e.tar.gz
nuttx-9cca35ff9bc8b9985aba67f2f39b4309b5e44c8e.tar.bz2
nuttx-9cca35ff9bc8b9985aba67f2f39b4309b5e44c8e.zip
LPC17xx DAC fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4521 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_adc.c2
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_dac.h194
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_internal.h2
-rw-r--r--nuttx/arch/sim/src/Makefile5
4 files changed, 103 insertions, 100 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_adc.c b/nuttx/arch/arm/src/lpc17xx/lpc17_adc.c
index e9e48a57e..c250f88e0 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_adc.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_adc.c
@@ -271,7 +271,7 @@ static int adc_interrupt(int irq, void *context)
*
****************************************************************************/
-FAR struct adc_dev_s *stm32_adcinitialize(void)
+FAR struct adc_dev_s *lpc17_adcinitialize(void)
{
return &g_adcdev;
}
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_dac.h b/nuttx/arch/arm/src/lpc17xx/lpc17_dac.h
index 18d008c63..e1e7c1b40 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_dac.h
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_dac.h
@@ -1,97 +1,97 @@
-/************************************************************************************
- * arch/arm/src/lpc17xx/lpc17_dac.h
- *
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-#ifndef __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H
-#define __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include <nuttx/config.h>
-
-#include "chip.h"
-#include "lpc17_memorymap.h"
-
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-
-/* Register offsets *****************************************************************/
-
-#define LPC17_DAC_CR_OFFSET 0x0000 /* D/A Converter Register */
-#define LPC17_DAC_CTRL_OFFSET 0x0004 /* DAC Control register */
-#define LPC17_DAC_CNTVAL_OFFSET 0x0008 /* DAC Counter Value register */
-
-/* Register addresses ***************************************************************/
-
-#define LPC17_DAC_CR (LPC17_DAC_BASE+LPC17_DAC_CR_OFFSET)
-#define LPC17_DAC_CTRL (LPC17_DAC_BASE+LPC17_DAC_CTRL_OFFSET)
-#define LPC17_DAC_CNTVAL (LPC17_DAC_BASE+LPC17_DAC_CNTVAL_OFFSET)
-
-/* Register bit definitions *********************************************************/
-
-/* D/A Converter Register */
- /* Bits 0-5: Reserved */
-#define DAC_CR_VALUE_SHIFT (6) /* Bits 6-15: Controls voltage on the AOUT pin */
-#define DAC_CR_VALUE_MASK (0x3ff << DAC_CR_VALUE_SHIFT)
-#define DAC_CR_BIAS (1 << 16) /* Bit 16: Controls DAC settling time
- /* Bits 17-31: Reserved */
-/* DAC Control register */
-
-#define DAC_CTRL_INTDMAREQ (1 << 0) /* Bit 0: Timer timed out */
-#define DAC_CTRL_DBLBUFEN (1 << 1) /* Bit 1: Enable DACR double-buffering */
-#define DAC_CTRL_CNTEN (1 << 2) /* Bit 2: Enable timeout counter */
-#define DAC_CTRL_DMAEN (1 << 3) /* Bit 3: Enable DMA access */
- /* Bits 4-31: Reserved */
-/* DAC Counter Value register */
-
-#define DAC_CNTVAL_SHIFT (0) /* Bits 0-15: Reload value for DAC interrupt/DMA timer */
-#define DAC_CNTVAL_MASK (0xffff << DAC_CNTVAL_SHIFT)
- /* Bits 8-31: Reserved */
-
-/************************************************************************************
- * Public Types
- ************************************************************************************/
-
-/************************************************************************************
- * Public Data
- ************************************************************************************/
-
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
-
-#endif /* __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H */
+/************************************************************************************
+ * arch/arm/src/lpc17xx/lpc17_dac.h
+ *
+ * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H
+#define __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "chip.h"
+#include "lpc17_memorymap.h"
+
+/************************************************************************************
+ * Pre-processor Definitions
+ ************************************************************************************/
+
+/* Register offsets *****************************************************************/
+
+#define LPC17_DAC_CR_OFFSET 0x0000 /* D/A Converter Register */
+#define LPC17_DAC_CTRL_OFFSET 0x0004 /* DAC Control register */
+#define LPC17_DAC_CNTVAL_OFFSET 0x0008 /* DAC Counter Value register */
+
+/* Register addresses ***************************************************************/
+
+#define LPC17_DAC_CR (LPC17_DAC_BASE+LPC17_DAC_CR_OFFSET)
+#define LPC17_DAC_CTRL (LPC17_DAC_BASE+LPC17_DAC_CTRL_OFFSET)
+#define LPC17_DAC_CNTVAL (LPC17_DAC_BASE+LPC17_DAC_CNTVAL_OFFSET)
+
+/* Register bit definitions *********************************************************/
+
+/* D/A Converter Register */
+ /* Bits 0-5: Reserved */
+#define DAC_CR_VALUE_SHIFT (6) /* Bits 6-15: Controls voltage on the AOUT pin */
+#define DAC_CR_VALUE_MASK (0x3ff << DAC_CR_VALUE_SHIFT)
+#define DAC_CR_BIAS (1 << 16) /* Bit 16: Controls DAC settling time */
+ /* Bits 17-31: Reserved */
+/* DAC Control register */
+
+#define DAC_CTRL_INTDMAREQ (1 << 0) /* Bit 0: Timer timed out */
+#define DAC_CTRL_DBLBUFEN (1 << 1) /* Bit 1: Enable DACR double-buffering */
+#define DAC_CTRL_CNTEN (1 << 2) /* Bit 2: Enable timeout counter */
+#define DAC_CTRL_DMAEN (1 << 3) /* Bit 3: Enable DMA access */
+ /* Bits 4-31: Reserved */
+/* DAC Counter Value register */
+
+#define DAC_CNTVAL_SHIFT (0) /* Bits 0-15: Reload value for DAC interrupt/DMA timer */
+#define DAC_CNTVAL_MASK (0xffff << DAC_CNTVAL_SHIFT)
+ /* Bits 8-31: Reserved */
+
+/************************************************************************************
+ * Public Types
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public Data
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+
+#endif /* __ARCH_ARM_SRC_LPC17XX_LPC17_DAC_H */
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h b/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h
index fc635eb7d..a3d03b5db 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h
@@ -808,7 +808,7 @@ EXTERN void lpc17_dmadump(DMA_HANDLE handle, const struct lpc17_dmaregs_s *regs,
****************************************************************************/
#ifdef CONFIG_LPC17_ADC
-FAR struct adc_dev_s *stm32_adcinitialize(void);
+FAR struct adc_dev_s *lpc17_adcinitialize(void);
#endif
/****************************************************************************
diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile
index e457e5411..8a228ec39 100644
--- a/nuttx/arch/sim/src/Makefile
+++ b/nuttx/arch/sim/src/Makefile
@@ -188,7 +188,10 @@ nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS)
# This is part of the top-level export target
-export_head:
+export_head: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS)
+ cp up_head.o $(HOSTOBJS) ${EXPORT_DIR}/startup
+ cp nuttx-names.dat ${EXPORT_DIR}/libs
+ echo main NXmain >> ${EXPORT_DIR}/libs/nuttx-names.dat
# Dependencies