KL and LPC11: Perform similar name change as for STM32: xyz_lowputc -> up_putc

This commit is contained in:
Gregory Nutt 2016-06-04 11:29:27 -06:00
parent 184ca294e8
commit 4965d0dc99
12 changed files with 36 additions and 157 deletions

View File

@ -70,7 +70,7 @@ CMN_CSRCS += up_dumpnvic.c
endif
CHIP_ASRCS =
CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c kl_lowgetc.c
CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c kl_getc.c
CHIP_CSRCS += kl_lowputc.c kl_serial.c kl_start.c kl_cfmconfig.c
ifneq ($(CONFIG_SCHED_TICKLESS),y)

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/kl/kl_lowgetc.c
* arch/arm/src/kl/kl_getc.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -41,40 +41,23 @@
#include <stdint.h>
#include <arch/irq.h>
#include <arch/board/board.h>
#include "up_internal.h"
#include "up_arch.h"
#include "kl_config.h"
#include "kl_lowgetc.h"
#include "chip/kl_uart.h"
#include "kl_getc.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Select UART parameters for the selected console */
#if defined(CONFIG_UART0_SERIAL_CONSOLE)
# define CONSOLE_BASE KL_UART0_BASE
# define CONSOLE_FREQ BOARD_CORECLK_FREQ
# define CONSOLE_BAUD CONFIG_UART0_BAUD
# define CONSOLE_BITS CONFIG_UART0_BITS
# define CONSOLE_PARITY CONFIG_UART0_PARITY
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
# define CONSOLE_BASE KL_UART1_BASE
# define CONSOLE_FREQ BOARD_BUSCLK_FREQ
# define CONSOLE_BAUD CONFIG_UART1_BAUD
# define CONSOLE_BITS CONFIG_UART1_BITS
# define CONSOLE_PARITY CONFIG_UART1_PARITY
#elif defined(CONFIG_UART2_SERIAL_CONSOLE)
# define CONSOLE_BASE KL_UART2_BASE
# define CONSOLE_FREQ BOARD_BUSCLK_FREQ
# define CONSOLE_BAUD CONFIG_UART2_BAUD
# define CONSOLE_BITS CONFIG_UART2_BITS
# define CONSOLE_PARITY CONFIG_UART2_PARITY
#endif
/****************************************************************************
@ -82,14 +65,14 @@
****************************************************************************/
/****************************************************************************
* Name: kl_lowgetc
* Name: up_getc
*
* Description:
* Input one byte from the serial console
*
****************************************************************************/
int kl_lowgetc(void)
int up_getc(void)
{
uint8_t ch = 0;
@ -98,11 +81,11 @@ int kl_lowgetc(void)
* we have data in the buffer to read.
*/
while ((getreg8(CONSOLE_BASE+KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0);
while ((getreg8(CONSOLE_BASE + KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0);
/* Then read a character from the UART data register */
ch = getreg8(CONSOLE_BASE+KL_UART_D_OFFSET);
ch = getreg8(CONSOLE_BASE + KL_UART_D_OFFSET);
#endif
return (int)ch;

View File

@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/kl/kl_lowgetc.h
* arch/arm/src/kl/kl_getc.h
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,42 +33,16 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H
#define __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H
#ifndef __ARCH_ARM_SRC_KL_KINETIS_GETC_H
#define __ARCH_ARM_SRC_KL_KINETIS_GETC_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include "kl_config.h"
#include "chip/kl_uart.h"
/************************************************************************************
* Public Data
************************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifdef HAVE_SERIAL_CONSOLE
int kl_lowgetc(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H */
#endif /* __ARCH_ARM_SRC_KL_KINETIS_GETC_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/kl/kl_serial.c
*
* Copyright (C) 2013-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -59,15 +59,14 @@
#include "kl_config.h"
#include "kl_lowputc.h"
#include "kl_lowgetc.h"
#include "chip.h"
#include "kl_gpio.h"
#include "chip/kl_uart.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Some sanity checks *******************************************************/
/* Is there at least one UART enabled and configured as a RS-232 device? */
@ -958,18 +957,4 @@ int up_putc(int ch)
return ch;
}
/****************************************************************************
* Name: up_getc
*
* Description:
* Provide priority, low-level access to support OS debug writes
*
****************************************************************************/
int up_getc(void)
{
/* Check for LF */
return kl_lowgetc();
}
#endif /* USE_SERIALDRIVER */

View File

@ -71,7 +71,7 @@ endif
CHIP_ASRCS =
CHIP_CSRCS = lpc11_clockconfig.c lpc11_gpio.c lpc11_i2c.c lpc11_idle.c
CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_lowgetc.c lpc11_serial.c
CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_getc.c lpc11_serial.c
CHIP_CSRCS += lpc11_spi.c lpc11_ssp.c lpc11_start.c
# Configuration-dependent LPC11xx files

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/lpc11/lpc11_lowgetc.c
* arch/arm/src/lpc11/lpc11_getc.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -41,42 +41,22 @@
#include <stdint.h>
#include <arch/irq.h>
#include <arch/board/board.h>
#include "up_internal.h"
#include "up_arch.h"
#include "chip/lpc11_syscon.h"
#include "chip/lpc11_uart.h"
#include "lpc11_gpio.h"
#include "lpc11_lowgetc.h"
#include "lpc11_serial.h"
#include "lpc11_getc.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Select UART parameters for the selected console */
#if defined(CONFIG_UART0_SERIAL_CONSOLE)
# define CONSOLE_BASE LPC11_UART0_BASE
# define CONSOLE_FREQ BOARD_CORECLK_FREQ
# define CONSOLE_BAUD CONFIG_UART0_BAUD
# define CONSOLE_BITS CONFIG_UART0_BITS
# define CONSOLE_PARITY CONFIG_UART0_PARITY
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
# define CONSOLE_BASE LPC11_UART1_BASE
# define CONSOLE_FREQ BOARD_BUSCLK_FREQ
# define CONSOLE_BAUD CONFIG_UART1_BAUD
# define CONSOLE_BITS CONFIG_UART1_BITS
# define CONSOLE_PARITY CONFIG_UART1_PARITY
#elif defined(CONFIG_UART2_SERIAL_CONSOLE)
# define CONSOLE_BASE LPC11_UART2_BASE
# define CONSOLE_FREQ BOARD_BUSCLK_FREQ
# define CONSOLE_BAUD CONFIG_UART2_BAUD
# define CONSOLE_BITS CONFIG_UART2_BITS
# define CONSOLE_PARITY CONFIG_UART2_PARITY
#endif
/****************************************************************************
@ -84,14 +64,14 @@
****************************************************************************/
/****************************************************************************
* Name: lpc11_lowgetc
* Name: up_getc
*
* Description:
* Input one byte from the serial console
*
****************************************************************************/
int lpc11_lowgetc(void)
int up_getc(void)
{
uint8_t ch = 0;

View File

@ -1,5 +1,5 @@
/************************************************************************************
* arch/arm/src/lpc11/lpc11_lowgetc.h
* arch/arm/src/lpc11/lpc11_getc.h
*
* Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H
#define __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H
#ifndef __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H
#define __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H
/************************************************************************************
* Included Files
@ -42,33 +42,6 @@
#include <nuttx/config.h>
#include "lpc11_serial.h"
#include "chip/lpc11_uart.h"
/************************************************************************************
* Public Data
************************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Functions
************************************************************************************/
#ifdef HAVE_SERIAL_CONSOLE
int lpc11_lowgetc(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H */
#endif /* __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H */

View File

@ -64,7 +64,6 @@
#include "chip.h"
#include "chip/lpc11_uart.h"
#include "lpc11_gpio.h"
#include "lpc11_lowgetc.h"
#include "lpc11_serial.h"
/****************************************************************************
@ -1041,19 +1040,4 @@ int up_putc(int ch)
return ch;
}
/****************************************************************************
* Name: up_getc
*
* Description:
* Provide priority, low-level access to support OS debug writes
*
****************************************************************************/
int up_getc(void)
{
/* Check for LF */
return lpc11_lowgetc();
}
#endif /* USE_SERIALDRIVER */

View File

@ -110,7 +110,7 @@ CHIP_ASRCS =
CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c
CHIP_CSRCS += stm32_lsi.c stm32_gpio.c stm32_exti_gpio.c stm32_flash.c
CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c stm32_lowgetc.c
CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c stm32_getc.c
CHIP_CSRCS += stm32_serial.c stm32_spi.c stm32_sdio.c stm32_tim.c
CHIP_CSRCS += stm32_waste.c stm32_ccm.c stm32_uid.c stm32_capture.c

View File

@ -92,7 +92,7 @@
#include "stm32_usbdev.h"
#include "stm32_wdg.h"
#include "stm32_lowputc.h"
#include "stm32_lowgetc.h"
#include "stm32_getc.h"
#include "stm32_eth.h"
#endif /* __ARCH_ARM_SRC_STM32_STM32_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/stm32/stm32_lowgetc.c
* arch/arm/src/stm32/stm32_getc.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -1,5 +1,5 @@
/************************************************************************************
* arch/arm/src/stm32/stm32_lowgetc.h
* arch/arm/src/stm32/stm32_getc.h
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H
#define __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H
#ifndef __ARCH_ARM_SRC_STM32_STM32_GETC_H
#define __ARCH_ARM_SRC_STM32_STM32_GETC_H
/************************************************************************************
* Included Files
@ -44,4 +44,4 @@
#include "chip.h"
#endif /* __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H */
#endif /* __ARCH_ARM_SRC_STM32_STM32_GETC_H */