📄 board.c
字号:
/* * File : board.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://openlab.rt-thread.com/license/LICENSE * * Change Logs: * Date Author Notes * 2006-03-24 Bernard first implementation * 2006-05-05 Bernard add DATA_COUNT definition */#include <rtthread.h>#include <rthw.h>#include <s3c4510.h>#define DATA_COUNT 0x7a120/** * @addtogroup lumit4510 *//*@{*/void rt_timer_handler(int vector){ /* reset TDATA0 */ TDATA0 = DATA_COUNT; rt_tick_increase();}/** * This function will initialize lumit4510 board */void rt_hw_board_init(){ /* set timer0 register */ TDATA0 = DATA_COUNT; TCNT0 = 0x0; TMOD = 0x3; /* install interrupt handler */ rt_hw_interrupt_install(INTTIMER0, rt_timer_handler, RT_NULL); rt_hw_interrupt_umask(INTTIMER0);}/** * This function will set led status. * @param led the led status */void rt_hw_led_set(rt_uint32_t led){ IOPDATA = 1 << led;}void rt_hw_led_flash(void){ int i; rt_hw_led_set(4); for ( i = 0; i < 2000000; i++); rt_hw_led_set(5); for ( i = 0; i < 2000000; i++); rt_hw_led_set(6); for ( i = 0; i < 2000000; i++); rt_hw_led_set(17); for ( i = 0; i < 2000000; i++);}#ifdef RT_USING_FINSHextern void finsh_notify(void);void rt_serial_isr(int vector){ finsh_notify();}void rt_hw_finsh_init(){ /* install UART isr */ rt_hw_interrupt_install(INTUART0_RX, rt_serial_isr, RT_NULL); rt_hw_interrupt_umask(INTUART0_RX);}#endif/*@}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -