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

📄 syslib_depend.h

📁 日本著名的的嵌入式实时操作系统T-Kernel的源码及用户手册。
💻 H
字号:
/* *---------------------------------------------------------------------- *    T-Kernel * *    Copyright (C) 2004 by Ken Sakamura. All rights reserved. *    T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * *    Version:   1.01.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2004/6/28. * *---------------------------------------------------------------------- *//* *	@(#)syslib_depend.h (tk/MB87Q1100) * *	T-Kernel/SM MB87Q1100 Library */#ifndef __TK_SYSLIB_DEPEND_H__#define __TK_SYSLIB_DEPEND_H__#include <tk/errno.h>#ifdef __cplusplusextern "C" {#endif/* * CPU interrupt control *	'intsts' is the value of CPSR in CPU *	disint()  Set CPSR.I = 1 and return the original CPSR *		  to the return value. *	enaint()  Set CPSR.I = intsts.I. Do not change except *		  for CPSR.I. *		  Return the original CPSR to the return value. */IMPORT UINT disint( void );IMPORT UINT enaint( UINT intsts );#define	DI(intsts)	( (intsts) = disint() )#define	EI(intsts)	( enaint(intsts) )#define	isDI(intsts)	( ((intsts) & 0x00c0) != 0 )/* * Interrupt vector *	The interrupt vector is the index number of the vector table. */typedef UINT	INTVEC;/* Convert to interrupt definition number */#define	DINTNO(intvec)	(intvec)/* * Interrupt vector value (part) */#define	IV_IRQ(n)	( 32 + (n) )	/* IRQ (0-31) */#define	IV_CPLD(n)	( 71 - (n) )	/* CPLD TINT (bit 0-7) */#define	IV_FPGA1(n)	( 79 - (n) )	/* FPGA IRQ_STR1 (bit 0-7) */#define	IV_FPGA2(n)	( 87 - (n) )	/* FPGA IRQ_STR2 (bit 0-7) */#define	IV_INT_A(n)	IV_IRQ(((n)^4)+6)	/* External INT_A (0-7) */#define	IV_EXBOARD	IV_FPGA2(6)		/* Extension board *//* * Interrupt controller operation *	Operation functions of interrupt controller support IRQ, GPIO, FPGA *	interrupts. Some functions treat part of those interrupts. *	FIQ interrupt is specified by IRQ interrupt vector which means the *	same factor. If invalid vector is specified, operation is not *	guaranteed. *//* * Set interrupt enable level *	Disable IRQ interrupts which level is less then or equal to specified *	'level'. 'level' must be '0'-'15'. *	If '15' is specified, all level IRQ interrupts are enable. *	If '0' is specified, all level IRQ interrupts are disable. *	'level' is set to the ILM register of interrupt controller. *	Initial value is '15'. *	This function returns the interrupt enable level before being changed. */IMPORT INT SetIntLevel( INT level );/* * Set interrupt mode *	Set accept mode to 'mode' regarding interrupt specified by 'intvec'. *	If 'mode' is not correct value, operation is not guaranteed. */IMPORT void SetIntMode( INTVEC intvec, UINT mode );#define	IM_LEVEL	0x00	/* level trigger */#define	IM_EDGE		0x02	/* edge  trigger */#define	IM_HI		0x01	/* high level trigger/rising  edge trigger */#define	IM_LOW		0x00	/* low  level trigger/falling edge trigger *//* * Enable interrupt *	Enable interrupt specified by 'intvec'. * *	For IRQ, level := '0'-'14'. *	level=14 means lowest priority level, level=0 means highest. *	If 'level' is outside this range, operation is not guaranteed. *	Set the ICRn register with the value 'level'. */IMPORT void EnableInt( INTVEC intvec, INT level );/* * Disable interrupt *	Disable interrupt specified by 'intvec'. */IMPORT void DisableInt( INTVEC intvec );/* * Clear interrupt request */IMPORT void ClearInt( INTVEC intvec );/* * Check for existence of interrupt request *	Check whether there is an interrupt request specified by 'intvec'. *	If there is an interrupt request, return TRUE (except 0). */IMPORT BOOL CheckInt( INTVEC intvec );/* * Issue EOI(End Of Interrupt) */IMPORT void EndOfInt( INTVEC intvec );/* ------------------------------------------------------------------------ *//* * I/O port access *	Only memory mapped I/O for Arm */Inline void out_w( INT port, UW data ){	*(_UW*)port = data;}Inline void out_h( INT port, UH data ){	*(_UH*)port = data;}Inline void out_b( INT port, UB data ){	*(_UB*)port = data;}Inline UW in_w( INT port ){	return *(_UW*)port;}Inline UH in_h( INT port ){	return *(_UH*)port;}Inline UB in_b( INT port ){	return *(_UB*)port;}#ifdef __cplusplus}#endif#endif /* __TK_SYSLIB_DEPEND_H__ */

⌨️ 快捷键说明

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