[bsp] fixed typo in bsp/lpc824

This commit is contained in:
tanek liang 2017-07-29 14:57:36 +08:00
parent a9f03fb446
commit dc3d3817f6
3 changed files with 22 additions and 23 deletions

View File

@ -10,7 +10,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2006-08-31 Bernard first implementation * 2006-08-31 Bernard first implementation
* 2011-06-05 Bernard modify for STM32F107 version * 2017-07-29 Tanek modify for LPC8xx version
*/ */
#include <stdint.h> #include <stdint.h>
@ -20,7 +20,7 @@
#include "board.h" #include "board.h"
/** /**
* @addtogroup STM32 * @addtogroup LPC8xx
*/ */
/*@{*/ /*@{*/

View File

@ -54,10 +54,9 @@ void SysTick_Handler(void)
rt_interrupt_leave(); rt_interrupt_leave();
} }
/* re-implement tick interface for STM32 HAL */
/** /**
* This function will initial STM32 board. * This function will initial LPC8XX board.
*/ */
void rt_hw_board_init() void rt_hw_board_init()
{ {

View File

@ -24,8 +24,8 @@
#define UART_RX_BUFSZ 8 #define UART_RX_BUFSZ 8
/* STM32 uart driver */ /* LPC8XX uart driver */
struct stm32_uart struct lpc8xx_uart
{ {
struct rt_device parent; struct rt_device parent;
struct rt_ringbuffer rx_rb; struct rt_ringbuffer rx_rb;
@ -35,18 +35,18 @@ struct stm32_uart
}; };
#ifdef RT_USING_UART0 #ifdef RT_USING_UART0
struct stm32_uart uart0_device; struct lpc8xx_uart uart0_device;
#endif #endif
#ifdef RT_USING_UART1 #ifdef RT_USING_UART1
struct stm32_uart uart1_device; struct lpc8xx_uart uart1_device;
#endif #endif
#ifdef RT_USING_UART2 #ifdef RT_USING_UART2
struct stm32_uart uart2_device; struct lpc8xx_uart uart2_device;
#endif #endif
void uart_irq_handler(struct stm32_uart* uart) void uart_irq_handler(struct lpc8xx_uart* uart)
{ {
uint32_t status; uint32_t status;
@ -147,9 +147,9 @@ static void uart_ll_init(LPC_USART_T * uart)
static rt_err_t rt_uart_init (rt_device_t dev) static rt_err_t rt_uart_init (rt_device_t dev)
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
RT_ASSERT(dev != RT_NULL); RT_ASSERT(dev != RT_NULL);
uart = (struct stm32_uart *)dev; uart = (struct lpc8xx_uart *)dev;
uart1_io_init(uart->uart_base); uart1_io_init(uart->uart_base);
uart_ll_init(uart->uart_base); uart_ll_init(uart->uart_base);
@ -159,9 +159,9 @@ static rt_err_t rt_uart_init (rt_device_t dev)
static rt_err_t rt_uart_open(rt_device_t dev, rt_uint16_t oflag) static rt_err_t rt_uart_open(rt_device_t dev, rt_uint16_t oflag)
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
RT_ASSERT(dev != RT_NULL); RT_ASSERT(dev != RT_NULL);
uart = (struct stm32_uart *)dev; uart = (struct lpc8xx_uart *)dev;
if (dev->flag & RT_DEVICE_FLAG_INT_RX) if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{ {
@ -174,9 +174,9 @@ static rt_err_t rt_uart_open(rt_device_t dev, rt_uint16_t oflag)
static rt_err_t rt_uart_close(rt_device_t dev) static rt_err_t rt_uart_close(rt_device_t dev)
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
RT_ASSERT(dev != RT_NULL); RT_ASSERT(dev != RT_NULL);
uart = (struct stm32_uart *)dev; uart = (struct lpc8xx_uart *)dev;
if (dev->flag & RT_DEVICE_FLAG_INT_RX) if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{ {
@ -193,9 +193,9 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si
rt_base_t level; rt_base_t level;
rt_size_t length; rt_size_t length;
struct stm32_uart* uart; struct lpc8xx_uart* uart;
RT_ASSERT(serial != RT_NULL); RT_ASSERT(serial != RT_NULL);
uart = (struct stm32_uart *)dev; uart = (struct lpc8xx_uart *)dev;
RT_ASSERT(uart != RT_NULL); RT_ASSERT(uart != RT_NULL);
@ -212,9 +212,9 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si
static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size)
{ {
char *ptr = (char*) buffer; char *ptr = (char*) buffer;
struct stm32_uart* uart; struct lpc8xx_uart* uart;
RT_ASSERT(serial != RT_NULL); RT_ASSERT(serial != RT_NULL);
uart = (struct stm32_uart *)dev; uart = (struct lpc8xx_uart *)dev;
if (dev->open_flag & RT_DEVICE_FLAG_STREAM) if (dev->open_flag & RT_DEVICE_FLAG_STREAM)
{ {
@ -253,7 +253,7 @@ int rt_hw_usart_init(void)
{ {
#ifdef RT_USING_UART0 #ifdef RT_USING_UART0
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
/* get uart device */ /* get uart device */
uart = &uart1_device; uart = &uart1_device;
@ -280,7 +280,7 @@ int rt_hw_usart_init(void)
#ifdef RT_USING_UART1 #ifdef RT_USING_UART1
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
/* get uart device */ /* get uart device */
uart = &uart1_device; uart = &uart1_device;
@ -307,7 +307,7 @@ int rt_hw_usart_init(void)
#ifdef RT_USING_UART2 #ifdef RT_USING_UART2
{ {
struct stm32_uart* uart; struct lpc8xx_uart* uart;
/* get uart device */ /* get uart device */
uart = &uart2_device; uart = &uart2_device;