📄 target.h
字号:
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: Target.h
** Last modified Date: 2007-01-18
** Last Version: 1.0
** Description: Header file of the target board 目标板头文件
**
**------------------------------------------------------------------------------------------------------
** Created By: Steven Zhou 周绍刚
** Created date: 2007-01-18
** Version: 1.0
** Descriptions: The original version 初始版本
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
********************************************************************************************************/
#ifndef __TARGET_H__
#define __TARGET_H__
/********************************************************************************************************
* User's settings 用户设定 *
********************************************************************************************************/
/************************************************
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 0 //1:Enable LED1 使能LED1
#define TARGET_LED2_EN 0 //1:Enable LED2 使能LED2
#define TARGET_LED3_EN 0 //1:Enable LED3 使能LED3
#define TARGET_LED4_EN 0 //1:Enable LED4 使能LED4
#define TARGET_BUZ_EN 1 //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 1 //1:Eanble the Timer0A API functions 使能定时器0A API 函数
#if TARGET_LED1_EN > 0
#define LED1_SYSCTL SYSCTL_PERIPH_GPIOD //System control of LED1 LED1的系统控制
#define LED1_GPIO_PORT GPIO_PORTD_BASE //IO port of LED1 LED1使用的IO口
#define LED1_PIN GPIO_PIN_7 //Pin number of LED1 LED1的引脚编号
#endif
#if TARGET_LED2_EN > 0
#define LED2_SYSCTL SYSCTL_PERIPH_GPIOC //System control of LED2 LED2的系统控制
#define LED2_GPIO_PORT GPIO_PORTC_BASE //IO port of LED2 LED2使用的IO口
#define LED2_PIN GPIO_PIN_5 //Pin number of LED2 LED2的引脚编号
#endif
#if TARGET_LED3_EN > 0
#define LED3_SYSCTL SYSCTL_PERIPH_GPIOC //System control of LED3 LED3的系统控制
#define LED3_GPIO_PORT GPIO_PORTC_BASE //IO port of LED3 LED3使用的IO口
#define LED3_PIN GPIO_PIN_6 //Pin number of LED3 LED3的引脚编号
#endif
#if TARGET_LED4_EN > 0
#define LED4_SYSCTL SYSCTL_PERIPH_GPIOC //System control of LED4 LE4D的系统控制
#define LED4_GPIO_PORT GPIO_PORTC_BASE //IO port of LED4 LED4使用的IO口
#define LED4_PIN GPIO_PIN_4 //Pin number of LED4 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 蜂鸣器使用的IO口
#define BUZ_PIN GPIO_PIN_5 //Pin number of the buzzer 蜂鸣器的引脚编号
#endif
#if TARGET_KEY1_EN > 0
#define KEY1_SYSCTL SYSCTL_PERIPH_GPIOD //System control of Key1 Key1的系统控制
#define KEY1_GPIO_PORT GPIO_PORTD_BASE //IO port of Key1 Key1使用的IO口
#define KEY1_PIN GPIO_PIN_4 //Pin number of Key1 Key1的引脚编号
#endif
#if TARGET_KEY2_EN > 0
#define KEY2_SYSCTL SYSCTL_PERIPH_GPIOD //System control of Key2 Key2的系统控制
#define KEY2_GPIO_PORT GPIO_PORTD_BASE //IO port of Key2 Key2使用的IO口
#define KEY2_PIN GPIO_PIN_5 //Pin number of Key2 Key2的引脚编号
#endif
#if TARGET_KEY3_EN > 0
#define KEY3_SYSCTL SYSCTL_PERIPH_GPIOB //System control of Key3 Key3的系统控制
#define KEY3_GPIO_PORT GPIO_PORTB_BASE //IO port of Key3 Key3使用的IO口
#define KEY3_PIN GPIO_PIN_5 //Pin number of Key3 Key3的引脚编号
#endif
#if TARGET_KEY4_EN > 0
#define KEY4_SYSCTL SYSCTL_PERIPH_GPIOA //System control of Key4 Key4的系统控制
#define KEY4_GPIO_PORT GPIO_PORTA_BASE //IO port of Key4 Key4使用的IO口
#define KEY4_PIN GPIO_PIN_4 //Pin number of Key4 Key4的引脚编号
#endif
/********************************************************************************************************
* End of user's settings 用户设定结束 *
********************************************************************************************************/
/********************************************************************************************************
* Function Prototypes 函数原型 *
********************************************************************************************************/
/*********************************************************************************************************
** Function name: IntDisAll
**
** Descriptions: Disable all interrupts from the interrupt controller 关闭中断控制器的所有中断
**
** Input parameters: None 无
** Returned value: None 无
**
** Used global variables: None 无
** Calling modules: None 无
**
** Created by: Steven Zhou 周绍刚
** Created Date: 2007-01-18
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void IntDisAll(void);
/*********************************************************************************************************
** Function name: Led_Init
**
** Descriptions: Initialize the target board's leds,support up to 4 leds
** 初始化目标板的LED,最多支持4个
**
** Input parameters: None 无
** Returned value: None 无
**
** Used global variables: None 无
** Calling modules: SysCtlPeripheralEnable,GPIODirModeSet
**
** Created by: Steven Zhou 周绍刚
** Created Date: 2007-01-18
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#if (TARGET_LED1_EN>0) || (TARGET_LED2_EN>0) || (TARGET_LED3_EN>0) || (TARGET_LED4_EN>0)
extern void Led_Init (void);
#endif
/*********************************************************************************************************
** Function name: Led_On
**
** 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,其他值无意义。
** Returned value: None 无
**
** Used global variables: None 无
** Calling modules: GPIOPinWrite
**
** Created by: Steven Zhou 周绍刚
** Created Date: 2007-01-18
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#if (TARGET_LED1_EN>0) || (TARGET_LED2_EN>0) || (TARGET_LED3_EN>0) || (TARGET_LED4_EN>0)
extern void Led_On (uint8 led);
#endif
/*********************************************************************************************************
** Function name: Led_Off
**
** 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,其他值无意义。
** Returned value: None 无
**
** Used global variables: None 无
** Calling modules: GPIOPinWrite
**
** Created by: Steven Zhou 周绍刚
** Created Date: 2007-01-18
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#if (TARGET_LED1_EN>0) || (TARGET_LED2_EN>0) || (TARGET_LED3_EN>0) || (TARGET_LED4_EN>0)
extern void Led_Off (uint8 led);
#endif
/*********************************************************************************************************
** Function name: Led_Toggle
**
** Descriptions: Toggle one or all of the LEDs 取反其中一个或全部的LED
**
** Input parameters: led: The num.of led to be toggled, 1-4 for LED1-LED4, 0xFF for all leds, others no action
** led: 要取反的LED的号码,1-4代表LED1-LED4,0xFF代表全部LED,其他值无意义。
** Returned value: None 无
**
** Used global variables: None 无
** Calling modules: GPIOPinWrite,GPIOPinRead
**
** Created by: Steven Zhou 周绍刚
** Created Date: 2007-01-18
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -