diff options
Diffstat (limited to 'nuttx/arch/sh/src/sh1/sh1_lowputc.c')
-rw-r--r-- | nuttx/arch/sh/src/sh1/sh1_lowputc.c | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/nuttx/arch/sh/src/sh1/sh1_lowputc.c b/nuttx/arch/sh/src/sh1/sh1_lowputc.c new file mode 100644 index 000000000..0fd046984 --- /dev/null +++ b/nuttx/arch/sh/src/sh1/sh1_lowputc.c @@ -0,0 +1,160 @@ +/************************************************************************** + * arch/sh/src/sh1/sh1_lowputc.c + * + * Copyright (C) 2008 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 <sys/types.h> + +#include "up_internal.h" +#include "up_arch.h" + +#include "chip.h" + +/************************************************************************** + * Private Definitions + **************************************************************************/ + +/* Configuration **********************************************************/ + +/* Is there a serial console? */ + +#if defined(CONFIG_UART0_SERIAL_CONSOLE) || defined(CONFIG_UART1_SERIAL_CONSOLE) +# define HAVE_CONSOLE +#else +# undef HAVE_CONSOLE +#endif + +/* Select UART parameters for the selected console */ + +#if defined(CONFIG_UART0_SERIAL_CONSOLE) +# define SH1_UART_BASE +# define SH1_UART_BAUD CONFIG_UART0_BAUD +# define SH1_UART_BITS CONFIG_UART0_BITS +# define SH1_UART_PARITY CONFIG_UART0_PARITY +# define SH1_UART_2STOP CONFIG_UART0_2STOP +#elif defined(CONFIG_UART1_SERIAL_CONSOLE) +# define SH1_UART_BASE +# define SH1_UART_BAUD CONFIG_UART1_BAUD +# define SH1_UART_BITS CONFIG_UART1_BITS +# define SH1_UART_PARITY CONFIG_UART1_PARITY +# define SH1_UART_2STOP CONFIG_UART1_2STOP +#else +# error "No CONFIG_UARTn_SERIAL_CONSOLE Setting" +#endif + +/* Get mode setting */ + +#if SH1_UART_BITS == 7 +# define SH1_UARTCR_MODE +#elif SH1_UART_BITS == 8 +# define SH1_UARTCR_MODE SH1_UARTCR_MODE8BITP +#else +# error "Number of bits not supported" +#endif + +#if SH1_UART_PARITY == 0 || SH1_UART_PARITY == 2 +# define SH1_UARTCR_PARITY +#elif SH1_UART_PARITY == 1 +# define SH1_UARTCR_PARITY SH1_UARTCR_PARITYODD +#else +# error "Invalid parity selection" +#endif + +#if SH1_UART_2STOP != 0 +# define SH1_UARTCR_STOP +#else +# define SH1_UARTCR_STOP +#endif + +/************************************************************************** + * Private Types + **************************************************************************/ + +/************************************************************************** + * Private Function Prototypes + **************************************************************************/ + +/************************************************************************** + * Global Variables + **************************************************************************/ + +/************************************************************************** + * Private Variables + **************************************************************************/ + +/************************************************************************** + * Private Functions + **************************************************************************/ + +/************************************************************************** + * Public Functions + **************************************************************************/ + +/************************************************************************** + * Name: up_lowputc + * + * Description: + * Output one byte on the serial console + * + **************************************************************************/ + +void up_lowputc(char ch) +{ +#ifdef HAVE_CONSOLE +# warning "To be provided" +#endif +} + +/************************************************************************** + * Name: up_lowsetup + * + * Description: + * This performs basic initialization of the UART used for the serial + * console. Its purpose is to get the console output availabe as soon + * as possible. + * + **************************************************************************/ + +void up_lowsetup(void) +{ +#ifdef HAVE_CONSOLE +# warning "To be provided" +#endif +} + + |