📄 iar-
字号:
/****************************************Copyright (c)****************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info---------------------------------------------------------------------------------
** File Name: Target.h
** Last modified Date: 2007.12.12
** Last Version: v1.0
** Description: Header file of the target board 目标板头文件
**
**--------------------------------------------------------------------------------------------------------
** Created By: Steven Zhou 周绍刚
** Created date: 2007.12.12
** Version: v1.0
** Descriptions: The original version 初始版本
**
**--------------------------------------------------------------------------------------------------------
** Modified by: Kang qinhua
** Modified date: 2008.01.02
** Version: v1.1
** Description: The second version 第二版
**
*********************************************************************************************************/
#ifndef __TARGET_H
#define __TARGET_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************************************************
System Clock(CCLK) Setting 系统时钟(CCLK) 设定
CCLK must be less than or equal to 20MHz/50MHz(depend on the max. cclk of the CPU)
CCLK必须小于或等于20MHz/50MHz(根据单片机的最大CCLK而定)
If PLL_EN=0, CCLK=EXT_CLK/CCLK_DIV, CCLK must <=20MHZ/50MHz
If PLL_EN>0, CCLK=200MHz/CCLK_DIV, CCLK must <=20MHZ/50MHz
*********************************************************************************************************/
#define EXT_CLK SYSCTL_XTAL_6MHZ /* external clock 外部时钟 */
#define PLL_EN 0 /* 1:Enable PLL 使能PLL */
#define CCLK_DIV SYSCTL_SYSDIV_1 /* CCLK divider CCLK分频系数 */
/*********************************************************************************************************
Setting of the target board's API function
目标板API函数设定
*********************************************************************************************************/
#define TARGET_LED1_EN 1 /* 1:Enable LED1 使能LED1 */
#define TARGET_LED2_EN 1 /* 1:Enable LED2 使能LED2 */
#define TARGET_LED3_EN 1 /* 1:Enable LED3 使能LED3 */
#define TARGET_LED4_EN 1 /* 1:Enable LED4 使能LED4 */
#define TARGET_BUZ_EN 0 /* 1:Enable the buzzer */
#define TARGET_KEY1_EN 0 /* 1:Enable Key1 使能Key1 */
#define TARGET_KEY2_EN 0 /* 1:Enable Key2 使能Key2 */
#define TARGET_KEY3_EN 0 /* 1:Enable Key3 使能Key3 */
#define TARGET_KEY4_EN 0 /* 1:Enable Key4 使能Key4 */
#define TARGET_TMR0A_EN 0 /* 1:Eanble the Timer0A API
functions */
#if TARGET_LED1_EN > 0
#define LED1_SYSCTL SYSCTL_PERIPH_GPIOB /* System control of LED1 */
#define LED1_GPIO_PORT GPIO_PORTB_BASE /* IO port of LED1 */
#define LED1_PIN GPIO_PIN_6 /* Pin number of LED1 */
#endif
#if TARGET_LED2_EN > 0
#define LED2_SYSCTL SYSCTL_PERIPH_GPIOC /* System control of LED2 */
#define LED2_GPIO_PORT GPIO_PORTC_BASE /* IO port of LED2 */
#define LED2_PIN GPIO_PIN_5 /* Pin number of LED2 */
#endif
#if TARGET_LED3_EN > 0
#define LED3_SYSCTL SYSCTL_PERIPH_GPIOA /* System control of LED3 */
#define LED3_GPIO_PORT GPIO_PORTA_BASE /* IO port of LED3 */
#define LED3_PIN GPIO_PIN_4 /* Pin number of LED3 */
#endif
#if TARGET_LED4_EN > 0
#define LED4_SYSCTL SYSCTL_PERIPH_GPIOA /* System control of LED4 */
#define LED4_GPIO_PORT GPIO_PORTA_BASE /* IO port of LED4 */
#define LED4_PIN GPIO_PIN_5 /* Pin number of LED4 */
#endif
#if TARGET_BUZ_EN > 0
#define BUZ_SYSCTL SYSCTL_PERIPH_GPIOA /* System control of the buzzer*/
#define BUZ_GPIO_PORT GPIO_PORTA_BASE /* IO port of the buzzer */
#define BUZ_PIN GPIO_PIN_7 /* Pin number of the buzzer */
#endif
#if TARGET_KEY1_EN > 0
#define KEY1_SYSCTL SYSCTL_PERIPH_GPIOE /* System control of Key1 */
#define KEY1_GPIO_PORT GPIO_PORTE_BASE /* IO port of Key1 */
#define KEY1_PIN GPIO_PIN_2 /* Pin number of Key1 */
#endif
#if TARGET_KEY2_EN > 0
#define KEY2_SYSCTL SYSCTL_PERIPH_GPIOE /* System control of Key2 */
#define KEY2_GPIO_PORT GPIO_PORTE_BASE /* IO port of Key2 */
#define KEY2_PIN GPIO_PIN_3 /* Pin number of Key2 */
#endif
#if TARGET_KEY3_EN > 0
#define KEY3_SYSCTL SYSCTL_PERIPH_GPIOB /* System control of Key3 */
#define KEY3_GPIO_PORT GPIO_PORTB_BASE /* IO port of Key3 */
#define KEY3_PIN GPIO_PIN_4 /* Pin number of Key3 */
#endif
#if TARGET_KEY4_EN > 0
#define KEY4_SYSCTL SYSCTL_PERIPH_GPIOB /* System control of Key4 */
#define KEY4_GPIO_PORT GPIO_PORTB_BASE /* IO port of Key4 */
#define KEY4_PIN GPIO_PIN_5 /* Pin number of Key4 */
#endif
/*********************************************************************************************************
End of user's settings 用户设定结束
*********************************************************************************************************/
/*********************************************************************************************************
Function Prototypes 函数原型
*********************************************************************************************************/
/*********************************************************************************************************
** Function name: IntDisAll
** Descriptions: Disable all interrupts from the interrupt controller
** 关闭中断控制器的所有中断
** Input parameters: None 无
** Output parameters: None 无
** Returned value: None 无
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**-------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
extern void intDisAll(void);
/*********************************************************************************************************
** Function name: ledInit
** Descriptions: Initialize the target board's leds,support up to 4 leds
** 初始化目标板的LED,最多支持4个
** Input parameters: None 无
** Output parameters: None 无
** Returned value: None 无
** Created by: Steven Zhou 周绍刚
** Created Date: 2007.12.12
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**-------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#if (TARGET_LED1_EN > 0) || (TARGET_LED2_EN >0 ) || (TARGET_LED3_EN > 0) || (TARGET_LED4_EN > 0)
extern void ledInit(void);
#endif
/*********************************************************************************************************
** Function name: ledOn
** Descriptions: Switch on one or all of the LEDs 点亮其中一个或全部的LED
** Input parameters: led: The num.of led to be switched on, 1-4 for LED1-LED4,
** 0xFF for all leds, others no action
** led: 要点亮的LED的号码,1-4代表LED1-LED4,0xFF代表全部LED,其他值无意义。
** Output parameters: None 无
** Returned value: None 无
** Created by: Steven Zhou 周绍刚
** Created Date: 2007.12.12
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**-------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#if (TARGET_LED1_EN > 0) || (TARGET_LED2_EN > 0) || (TARGET_LED3_EN > 0) || (TARGET_LED4_EN > 0)
extern void ledOn(INT8U ucLed);
#endif
/*********************************************************************************************************
** Function name: ledOff
** Descriptions: Switch off one or all of the LEDs 关闭其中一个或全部的LED
** Input parameters: led: The num.of led to be switched off, 1-4 for LED1-LED4,
** 0xFF for all leds, others no action
** led: 要关闭的LED的号码,1-4代表LED1-LED4,0xFF代表全部LED,其他值无意义。
** Output parameters: None 无
** Returned value: None 无
** Created by: Steven Zhou 周绍刚
** Created Date: 2007.12.12
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**-------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#if (TARGET_LED1_EN > 0) || (TARGET_LED2_EN > 0) || (TARGET_LED3_EN > 0) || (TARGET_LED4_EN > 0)
extern void ledOff(INT8U ucLed);
#endif
/*********************************************************************************************************
** Function name: ledToggle
** Descriptions: Toggle one or all of the LEDs 取反其中一个或全部的LED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -