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

📄 common.h

📁 最新版IAR FOR ARM(EWARM)5.11中的代码例子
💻 H
字号:
/******************************************************************************

     Copyright (C) 2005 Oki Electric Industry Co.,LTD.

     System Name  :  ML69Q6203 CPU Board
     Module Name  :  common definition include file
     File   Name  :  common.h
     Revision     :  01.00
     Date         :  2005/03/06      First version

******************************************************************************/
#ifndef COMMON_H
#define COMMON_H

/*************************************************************************************************/
/*    common type definition                                                                     */
/*************************************************************************************************/
typedef char    BYTE;   /* byte */
typedef short   HWORD;  /* half word */
typedef long    WORD;   /* word */
typedef unsigned char   UBYTE;  /* unsigned byte */
typedef unsigned short  UHWORD; /* unsigned half word */
typedef unsigned long   UWORD;  /* unsigned word */


/*************************************************************************************************/
/*    internal I/O input/output macro                                                            */
/*************************************************************************************************/
#define get_value(n)    (*((volatile UBYTE *)(n)))          /* byte input */
#define put_value(n,c)  (*((volatile UBYTE *)(n)) = (c))    /* byte output */
#define get_hvalue(n)   (*((volatile UHWORD *)(n)))         /* half word input */
#define put_hvalue(n,c) (*((volatile UHWORD *)(n)) = (c))   /* half word output */
#define get_wvalue(n)   (*((volatile UWORD *)(n)))          /* word input */
#define put_wvalue(n,c) (*((volatile UWORD *)(n)) = (c))    /* word output */
#define set_bit(n,c)    (*((volatile UBYTE *)(n))|= (c))    /* byte bit set */
#define clr_bit(n,c)    (*((volatile UBYTE *)(n))&=~(c))    /* byte bit clear */
#define set_hbit(n,c)   (*((volatile UHWORD *)(n))|= (c))   /* half word bit set */
#define clr_hbit(n,c)   (*((volatile UHWORD *)(n))&=~(c))   /* half word bit clear */
#define set_wbit(n,c)   (*((volatile UWORD *)(n))|= (c))    /* word bit set */
#define clr_wbit(n,c)   (*((volatile UWORD *)(n))&=~(c))    /* word bit clear */

/*************************************************************************************************/
/*  LED on                                                                                       */
/*  Function : led_on                                                                            */
/*      Parameters                                                                               */
/*          Input   :   led pattern                                                              */
/*          Output  :   Nothing                                                                  */
/*************************************************************************************************/
void led_on(UHWORD pattern);

/*************************************************************************************************/
/*  init LED                                                                                     */
/*  Function : init_led                                                                          */
/*      Parameters                                                                               */
/*          Input   :   Nothing                                                                  */
/*          Output  :   Nothing                                                                  */
/*************************************************************************************************/
void init_led(void);

/* constants for led_on() */            /* led segment       dGFE_DCBA */
#define LED_START_PATTERN       0x0063  /* start pattern     0110_0011 */
#define LED_NORMAL_END_PATTERN  0x005C  /* end pattern       0101_1100 */

#define LED_0   0x003F  /* light "0" */
#define LED_1   0x0006  /* light "1" */
#define LED_2   0x005B  /* light "2" */
#define LED_3   0x004F  /* light "3" */
#define LED_4   0x0066  /* light "4" */
#define LED_5   0x006D  /* light "5" */
#define LED_6   0x007D  /* light "6" */
#define LED_7   0x0027  /* light "7" */
#define LED_8   0x007F  /* light "8" */
#define LED_9   0x006F  /* light "9" */
#define LED_A   0x0077  /* light "A" */
#define LED_b   0x007C  /* light "b" */
#define LED_C   0x0039  /* light "C" */
#define LED_d   0x005E  /* light "d" */
#define LED_E   0x0079  /* light "E" */
#define LED_F   0x0071  /* light "F" */

#define LED_all                 0x00FF  /* light all LEDs    1111_1111 */
#define LED_off                 0x0000  /* turn off all LEDs 0000_0000 */

extern  volatile unsigned int   count_interval;

#endif

⌨️ 快捷键说明

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