Add beginnings of a serial console

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2977 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2010-10-08 02:21:43 +00:00
parent d1df8ce7e7
commit 942855370e
8 changed files with 136 additions and 33 deletions

View File

@ -50,7 +50,7 @@ CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \
# Required AT91UC3 files
CHIP_ASRCS =
CHIP_CSRCS = at91uc3_lowinit.c at91uc3_serial.c
CHIP_CSRCS = at91uc3_lowconsole.c at91uc3_lowinit.c at91uc3_serial.c
# Configuration-dependent AT91UC3 files

View File

@ -59,17 +59,27 @@
************************************************************************************/
/************************************************************************************
* Name: at91uc3_clkinit
* Name: up_clkinit
*
* Description:
* Initialiaze clock/PLL settings per the definitions in the board.h file.
*
************************************************************************************/
extern void at91uc3_clkinitialize(void);
extern void up_clkinitialize(void);
/************************************************************************************
* Name: at91uc3_boardinit
* Name: up_consoleinit
*
* Description:
* Initialize a console for debug output.
*
************************************************************************************/
extern void up_consoleinit(void);
/************************************************************************************
* Name: up_boardinit
*
* Description:
* This function must be provided by the board-specific logic in the directory
@ -77,7 +87,7 @@ extern void at91uc3_clkinitialize(void);
*
************************************************************************************/
extern void at91uc3_boardinitialize(void);
extern void up_boardinitialize(void);
#endif /* __ARCH_AVR_SRC_AVR32_AT91UC3_INTERNAL_H */

View File

@ -0,0 +1,105 @@
/**************************************************************************
* arch/avr/src/at91uc3/at91uc3_lowconsole.c
*
* 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.
*
**************************************************************************/
/**************************************************************************
* Included Files
**************************************************************************/
#include <nuttx/config.h>
#include "at91uc3_config.h"
#include "up_internal.h"
#include "at91uc3_internal.h"
/**************************************************************************
* Private Definitions
**************************************************************************/
/**************************************************************************
* Private Types
**************************************************************************/
/**************************************************************************
* Private Function Prototypes
**************************************************************************/
/**************************************************************************
* Global Variables
**************************************************************************/
/**************************************************************************
* Private Variables
**************************************************************************/
/**************************************************************************
* Private Functions
**************************************************************************/
/**************************************************************************
* Public Functions
**************************************************************************/
/************************************************************************************
* Name: up_consoleinit
*
* Description:
* Initialize a console for debug output.
*
************************************************************************************/
void up_consoleinit(void)
{
#warning "Not Implemented"
}
/************************************************************************************
* Name: up_lowputc
*
* Description:
* Output one byte on the serial console
*
************************************************************************************/
void up_lowputc(char ch)
{
#ifdef HAVE_SERIAL_CONSOLE
/* Wait until the TX data register is empty */
#warning "Not Implemented"
/* Then send the character */
#warning "Not Implemented"
#endif
}

View File

@ -85,17 +85,23 @@ void up_lowinit(void)
{
/* Initialize MCU clocking */
at91uc3_clkinitialize();
up_clkinitialize();
/* Initialize a console */
up_consoleinit();
/* Perform early serial initialization (so that we will have debug output
* available as soon as possible.
* available as soon as possible).
*/
#ifdef CONFIG_USE_SERIALDRIVER
up_earlyserialinit();
#endif
/* Perform board-level initialization */
at91uc3_boardinitialize();
up_boardinitialize();
}

View File

@ -902,21 +902,3 @@ int up_putc(int ch)
#endif /* CONFIG_USE_SERIALDRIVER */
/**************************************************************************
* Name: up_lowputc
*
* Description:
* Output one byte on the serial console
*
**************************************************************************/
void up_lowputc(char ch)
{
#ifdef HAVE_SERIAL_CONSOLE
/* Wait until the TX data register is empty */
#warning "Not Implemented"
/* Then send the character */
#warning "Not Implemented"
#endif
}

View File

@ -65,14 +65,14 @@
************************************************************************************/
/************************************************************************************
* Name: avr32dev1_ledinitialize
* Name: up_ledinitialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
extern void avr32dev1_ledinitialize(void);
extern void up_ledinitialize(void);
#endif
#endif /* __ASSEMBLY__ */

View File

@ -63,7 +63,7 @@
************************************************************************************/
/************************************************************************************
* Name: at91uc3_boardinitialize
* Name: up_boardinitialize
*
* Description:
* All AVR32 architectures must provide the following entry point. This entry point
@ -72,13 +72,13 @@
*
************************************************************************************/
void at91uc3_boardinitialize(void)
void up_boardinitialize(void)
{
/* Configure SPI chip selects */
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
avr32dev1_ledinitialize();
up_ledinitialize();
#endif
}

View File

@ -100,10 +100,10 @@
****************************************************************************/
/****************************************************************************
* Name: up_ledinit
* Name: up_ledinitialize
****************************************************************************/
void up_ledinit(void)
void up_ledinitialize(void)
{
# warning "Not implemented"
}