CC3200 Launchpad updates

This commit is contained in:
Gregory Nutt 2014-08-26 16:31:47 -06:00
parent ef3337329a
commit 9601b334dd
7 changed files with 147 additions and 25 deletions

View File

@ -814,6 +814,7 @@ config ARCH_BOARD_CC3200_LAUNCHPAD
select ARCH_HAVE_LEDS select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS select ARCH_HAVE_IRQBUTTONS
select TIVA_BOARD_EARLYINIT
---help--- ---help---
Tiva CC3200 Launchpad. Tiva CC3200 Launchpad.

View File

@ -32,7 +32,7 @@
* *
************************************************************************************/ ************************************************************************************/
#ifdef __CONFIGS_CC3200_INCLUDE_UTILS_H #ifndef __CONFIGS_CC3200_INCLUDE_UTILS_H
#define __CONFIGS_CC3200_INCLUDE_UTILS_H 1 #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_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_mode_set(uint32_t pin, uint32_t pin_mode);
void cc3200_pin_type_uart(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 */ #endif /* __CONFIGS_CC3200_INCLUDE_UTILS_H */

View File

@ -40,6 +40,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include "cc3200_launchpad.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/

View File

@ -1,6 +1,5 @@
/************************************************************************************ /****************************************************************************
* configs/cc3200-launchpad/src/cc3200_boot.c * configs/cc3200-launchpad/src/cc3200_boot.c
* arch/arm/src/board/cc3200_boot.c
* *
* Copyright (C) 2014 Droidifi LLC. All rights reserved. * Copyright (C) 2014 Droidifi LLC. All rights reserved.
* Author: Jim Ewing <jim@droidifi.com> * Author: Jim Ewing <jim@droidifi.com>
@ -34,11 +33,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
@ -50,21 +49,23 @@
#include <arch/board/cc3200_utils.h> #include <arch/board/cc3200_utils.h>
#include <apps/nsh.h> #include <apps/nsh.h>
/************************************************************************************ #include "cc3200_launchpad.h"
/****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Private Functions * Private Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: nsh_archinitialize * Name: nsh_archinitialize
* *
@ -85,7 +86,7 @@ int nsh_archinitialize(void)
return OK; return OK;
} }
/************************************************************************************ /****************************************************************************
* Name: tiva_boardinitialize * Name: tiva_boardinitialize
* *
* Description: * Description:
@ -93,7 +94,7 @@ int nsh_archinitialize(void)
* point is called early in the initialization -- after all memory has been * point is called early in the initialization -- after all memory has been
* configured and mapped but before any devices have been initialized. * configured and mapped but before any devices have been initialized.
* *
************************************************************************************/ ****************************************************************************/
void tiva_boardinitialize(void) void tiva_boardinitialize(void)
{ {

View File

@ -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 */

View File

@ -46,10 +46,21 @@
#include <arch/board/cc3200_utils.h> #include <arch/board/cc3200_utils.h>
#include "chip/cc3200_memorymap.h" #include "chip/cc3200_memorymap.h"
#include "tiva_start.h"
#include "up_internal.h" #include "up_internal.h"
#include "cc3200_launchpad.h"
#if !defined(HAVE_SERIALCONSOLE) #if !defined(HAVE_SERIALCONSOLE)
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
#ifndef CONFIG_TIVA_BOARD_EARLYINIT
# error CONFIG_TIVA_BOARD_EARLYINIT is required
#endif
/************************************************************************************ /************************************************************************************
* Private Data * Private Data
************************************************************************************/ ************************************************************************************/
@ -57,7 +68,8 @@
/************************************************************************************ /************************************************************************************
* Private Functions * Private Functions
************************************************************************************/ ************************************************************************************/
void cc3200_uart0_init(void)
static void cc3200_uart0_init(void)
{ {
HWREG(0x44025048) |= 0x01; HWREG(0x44025048) |= 0x01;
@ -84,7 +96,7 @@ void cc3200_uart0_init(void)
************************************************************************************/ ************************************************************************************/
/************************************************************************************ /************************************************************************************
* Name: up_earlyconsoleinit * Name: board_earlyinit
* *
* Description: * Description:
* Performs the low level UART initialization early in debug so that the serial * 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 board_earlyinit(void)
void up_earlyconsoleinit(void)
{ {
cc3200_init(); cc3200_init();
cc3200_uart0_init(); cc3200_uart0_init();
} }
#endif
/************************************************************************************ /************************************************************************************
* Name: up_consoleinit * Name: up_consoleinit
* *
* Description: * Description:
* Register serial console and serial ports. This assumes that * 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 #endif
/************************************************************************************
* Name: cc3200_uart_init
************************************************************************************/
void cc3200_uart_init(void) void cc3200_uart_init(void)
{ {
cc3200_uart0_init(); cc3200_uart0_init();

View File

@ -32,8 +32,22 @@
* *
************************************************************************************/ ************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <sys/types.h> #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) void cc3200_putc(char c)
{ {
@ -43,6 +57,10 @@ void cc3200_putc(char c)
HWREG(0x4000C000) = c; HWREG(0x4000C000) = c;
} }
/************************************************************************************
* Name: cc3200_getc
************************************************************************************/
char cc3200_getc(void) char cc3200_getc(void)
{ {
if (!(HWREG(0x4000C000 + 0x00000018) & 0x00000010)) if (!(HWREG(0x4000C000 + 0x00000018) & 0x00000010))
@ -55,6 +73,10 @@ char cc3200_getc(void)
} }
} }
/************************************************************************************
* Name: cc3200_print
************************************************************************************/
void cc3200_print(char* str) void cc3200_print(char* str)
{ {
while (str && *str != '\0') 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) void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_type)
{ {
uint32_t pad; 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) void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode)
{ {
uint32_t pad; 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)); 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) void cc3200_pin_type_uart(uint32_t pin, uint32_t pin_mode)
{ {
cc3200_pin_mode_set(pin, pin_mode); cc3200_pin_mode_set(pin, pin_mode);
cc3200_pin_config_set(pin, PIN_STRENGTH_2MA, PIN_TYPE_STD); cc3200_pin_config_set(pin, PIN_STRENGTH_2MA, PIN_TYPE_STD);
} }
/************************************************************************************
* Name: cc3200_init
************************************************************************************/
void cc3200_init(void) void cc3200_init(void)
{ {
HWREG(0x4402F064) |= 0x800000; HWREG(0x4402F064) |= 0x800000;