summaryrefslogtreecommitdiff
path: root/nuttx/configs/cc3200-launchpad
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-26 16:31:47 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-26 16:31:47 -0600
commit5e00cc7c21585cac912d9443ddfea0175776fd13 (patch)
tree1964fc1c956410e2decd5c3a72b8d7772f878f64 /nuttx/configs/cc3200-launchpad
parentcefe78f6a5595a77dbf1ccc0ecc63dcc559f6e54 (diff)
downloadnuttx-5e00cc7c21585cac912d9443ddfea0175776fd13.tar.gz
nuttx-5e00cc7c21585cac912d9443ddfea0175776fd13.tar.bz2
nuttx-5e00cc7c21585cac912d9443ddfea0175776fd13.zip
CC3200 Launchpad updates
Diffstat (limited to 'nuttx/configs/cc3200-launchpad')
-rw-r--r--nuttx/configs/cc3200-launchpad/include/cc3200_utils.h4
-rw-r--r--nuttx/configs/cc3200-launchpad/src/cc3200_autoleds.c2
-rw-r--r--nuttx/configs/cc3200-launchpad/src/cc3200_boot.c31
-rw-r--r--nuttx/configs/cc3200-launchpad/src/cc3200_launchpad.h68
-rw-r--r--nuttx/configs/cc3200-launchpad/src/cc3200_serial.c26
-rw-r--r--nuttx/configs/cc3200-launchpad/src/cc3200_utils.c40
6 files changed, 146 insertions, 25 deletions
diff --git a/nuttx/configs/cc3200-launchpad/include/cc3200_utils.h b/nuttx/configs/cc3200-launchpad/include/cc3200_utils.h
index 400891c16..18b8ac51c 100644
--- a/nuttx/configs/cc3200-launchpad/include/cc3200_utils.h
+++ b/nuttx/configs/cc3200-launchpad/include/cc3200_utils.h
@@ -32,7 +32,7 @@
*
************************************************************************************/
-#ifdef __CONFIGS_CC3200_INCLUDE_UTILS_H
+#ifndef __CONFIGS_CC3200_INCLUDE_UTILS_H
#define __CONFIGS_CC3200_INCLUDE_UTILS_H 1
/************************************************************************************
@@ -143,7 +143,5 @@ void cc3200_print(char* str);
void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_type);
void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode);
void cc3200_pin_type_uart(uint32_t pin, uint32_t pin_mode);
-void cc3200_init(void);
-void cc3200_uart_init(void);
#endif /* __CONFIGS_CC3200_INCLUDE_UTILS_H */
diff --git a/nuttx/configs/cc3200-launchpad/src/cc3200_autoleds.c b/nuttx/configs/cc3200-launchpad/src/cc3200_autoleds.c
index adb7b8ebd..820618971 100644
--- a/nuttx/configs/cc3200-launchpad/src/cc3200_autoleds.c
+++ b/nuttx/configs/cc3200-launchpad/src/cc3200_autoleds.c
@@ -40,6 +40,8 @@
#include <nuttx/config.h>
+#include "cc3200_launchpad.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/configs/cc3200-launchpad/src/cc3200_boot.c b/nuttx/configs/cc3200-launchpad/src/cc3200_boot.c
index 3c2b85776..76d6e8811 100644
--- a/nuttx/configs/cc3200-launchpad/src/cc3200_boot.c
+++ b/nuttx/configs/cc3200-launchpad/src/cc3200_boot.c
@@ -1,6 +1,5 @@
-/************************************************************************************
+/****************************************************************************
* configs/cc3200-launchpad/src/cc3200_boot.c
- * arch/arm/src/board/cc3200_boot.c
*
* Copyright (C) 2014 Droidifi LLC. All rights reserved.
* Author: Jim Ewing <jim@droidifi.com>
@@ -34,11 +33,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/kmalloc.h>
@@ -50,21 +49,23 @@
#include <arch/board/cc3200_utils.h>
#include <apps/nsh.h>
-/************************************************************************************
+#include "cc3200_launchpad.h"
+
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************************************/
+ ****************************************************************************/
/****************************************************************************
* Name: nsh_archinitialize
*
@@ -85,7 +86,7 @@ int nsh_archinitialize(void)
return OK;
}
-/************************************************************************************
+/****************************************************************************
* Name: tiva_boardinitialize
*
* Description:
@@ -93,7 +94,7 @@ int nsh_archinitialize(void)
* point is called early in the initialization -- after all memory has been
* configured and mapped but before any devices have been initialized.
*
- ************************************************************************************/
+ ****************************************************************************/
void tiva_boardinitialize(void)
{
diff --git a/nuttx/configs/cc3200-launchpad/src/cc3200_launchpad.h b/nuttx/configs/cc3200-launchpad/src/cc3200_launchpad.h
new file mode 100644
index 000000000..2378023ad
--- /dev/null
+++ b/nuttx/configs/cc3200-launchpad/src/cc3200_launchpad.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * configs/cc3200-launchpad/src/cc3200_launchpad.h
+ *
+ * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * 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.
+ *
+ * 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 __CONFIGS_CC3200_LAUNCHPAD_SRC_CC3200_LAUNCHPAD_H
+#define __CONFIGS_CC3200_LAUNCHPAD_SRC_CC3200_LAUNCHPAD_H 1
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: cc3200_init
+ ****************************************************************************/
+
+void cc3200_init(void);
+
+/************************************************************************************
+ * Name: cc3200_uart_init
+ ************************************************************************************/
+
+void cc3200_uart_init(void);
+
+#endif /* __CONFIGS_CC3200_LAUNCHPAD_SRC_CC3200_LAUNCHPAD_H */
diff --git a/nuttx/configs/cc3200-launchpad/src/cc3200_serial.c b/nuttx/configs/cc3200-launchpad/src/cc3200_serial.c
index 20a43daa7..4d7715ab2 100644
--- a/nuttx/configs/cc3200-launchpad/src/cc3200_serial.c
+++ b/nuttx/configs/cc3200-launchpad/src/cc3200_serial.c
@@ -46,18 +46,30 @@
#include <arch/board/cc3200_utils.h>
#include "chip/cc3200_memorymap.h"
+#include "tiva_start.h"
#include "up_internal.h"
+#include "cc3200_launchpad.h"
+
#if !defined(HAVE_SERIALCONSOLE)
/************************************************************************************
+ * Pre-processor Definitions
+ ************************************************************************************/
+
+#ifndef CONFIG_TIVA_BOARD_EARLYINIT
+# error CONFIG_TIVA_BOARD_EARLYINIT is required
+#endif
+
+/************************************************************************************
* Private Data
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
-void cc3200_uart0_init(void)
+
+static void cc3200_uart0_init(void)
{
HWREG(0x44025048) |= 0x01;
@@ -84,7 +96,7 @@ void cc3200_uart0_init(void)
************************************************************************************/
/************************************************************************************
- * Name: up_earlyconsoleinit
+ * Name: board_earlyinit
*
* Description:
* Performs the low level UART initialization early in debug so that the serial
@@ -93,20 +105,18 @@ void cc3200_uart0_init(void)
*
************************************************************************************/
-#ifdef USE_EARLYSERIALINIT
-void up_earlyconsoleinit(void)
+void board_earlyinit(void)
{
cc3200_init();
cc3200_uart0_init();
}
-#endif
/************************************************************************************
* Name: up_consoleinit
*
* Description:
* Register serial console and serial ports. This assumes that
- * up_earlyconsoleinit was called previously.
+ * board_earlyinit was called previously.
*
************************************************************************************/
@@ -119,6 +129,10 @@ void up_consoleinit(void)
}
#endif
+/************************************************************************************
+ * Name: cc3200_uart_init
+ ************************************************************************************/
+
void cc3200_uart_init(void)
{
cc3200_uart0_init();
diff --git a/nuttx/configs/cc3200-launchpad/src/cc3200_utils.c b/nuttx/configs/cc3200-launchpad/src/cc3200_utils.c
index f763085fa..88f7c692a 100644
--- a/nuttx/configs/cc3200-launchpad/src/cc3200_utils.c
+++ b/nuttx/configs/cc3200-launchpad/src/cc3200_utils.c
@@ -32,8 +32,22 @@
*
************************************************************************************/
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
#include <sys/types.h>
-#include <cc3200_utils.h>
+#include <arch/board/cc3200_utils.h>
+
+#include "cc3200_launchpad.h"
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Name: cc3200_putc
+ ************************************************************************************/
void cc3200_putc(char c)
{
@@ -43,6 +57,10 @@ void cc3200_putc(char c)
HWREG(0x4000C000) = c;
}
+/************************************************************************************
+ * Name: cc3200_getc
+ ************************************************************************************/
+
char cc3200_getc(void)
{
if (!(HWREG(0x4000C000 + 0x00000018) & 0x00000010))
@@ -55,6 +73,10 @@ char cc3200_getc(void)
}
}
+/************************************************************************************
+ * Name: cc3200_print
+ ************************************************************************************/
+
void cc3200_print(char* str)
{
while (str && *str != '\0')
@@ -63,6 +85,10 @@ void cc3200_print(char* str)
}
}
+/************************************************************************************
+ * Name: cc3200_pin_config_set
+ ************************************************************************************/
+
void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_type)
{
uint32_t pad;
@@ -85,6 +111,10 @@ void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_typ
}
}
+/************************************************************************************
+ * Name: cc3200_pin_mode_set
+ ************************************************************************************/
+
void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode)
{
uint32_t pad;
@@ -94,12 +124,20 @@ void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode)
HWREG(pad) = (((HWREG(pad) & ~PAD_MODE_MASK) | pin_mode) & ~(3<<10));
}
+/************************************************************************************
+ * Name: cc3200_pin_type_uart
+ ************************************************************************************/
+
void cc3200_pin_type_uart(uint32_t pin, uint32_t pin_mode)
{
cc3200_pin_mode_set(pin, pin_mode);
cc3200_pin_config_set(pin, PIN_STRENGTH_2MA, PIN_TYPE_STD);
}
+/************************************************************************************
+ * Name: cc3200_init
+ ************************************************************************************/
+
void cc3200_init(void)
{
HWREG(0x4402F064) |= 0x800000;