⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board.c.svn-base

📁 RT-Thread是发展中的下一代微内核嵌入式实时操作系统
💻 SVN-BASE
字号:
/* * 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-10-25     Bernard      first implementation */#include <rtthread.h>#include <rthw.h>#include <pxa270.h>#include "board.h"/** * @addtogroup PXA270 *//*@{*/void rt_timer_handler(int vector){	rt_tick_increase();}/** * @brief init zaurus c1000 * * This function will init zaurus c1000 */void rt_hw_board_init(){	/* setup MMU for led */		/* setup MMU for vectos */		/* clear OS Timer counter4 */    PXA2X0_OST_OSCR4 = 0x00000000;	/* set OS Timer match4 */	PXA2X0_OST_OSMR4 = CLK4_TIMER_FREQUENCY / RT_TICK_PER_SECOND;	/* set OS Timer match control */	PXA2X0_OST_OMCR4 = 0xc1;	/* periodic timer & 32768Hz */		PXA2X0_OST_OSSR = 0x3f;		/* clear all OS Timer status */	PXA2X0_OST_OIER = 0x10;		/* enable OSMR4 interrupt */		/* install interrupt handler */	rt_hw_interrupt_install(PXA2X0_INT_OST, rt_timer_handler, RT_NULL);	rt_hw_interrupt_umask(PXA2X0_INT_OST);}#define C1K_SCOOP_BASE 0x10800000#define GPIOWP	0x24/**  * @param on, which led is operated, green or orange */void rt_hw_led_set(rt_uint32 enable){	volatile unsigned short *p;	p = (unsigned short*) (0x10800000 + 0x24);	if (enable)	{		*p = *p | (1 << 1);	}	else	{		*p = *p & (~(1 << 1));	}}void rt_hw_led_flash(void){	int i;	rt_hw_led_set(1);	for ( i = 0; i < 1000000; i++);	rt_hw_led_set(0);	for ( i = 0; i < 1000000; i++);}#ifdef RT_USING_FINSHextern void finsh_notify(void);void rt_serial_isr(int vector){	finsh_notify();}void rt_hw_finsh_init(){	/* install keyboard isr */}#endif/*@}*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -