?? init.c
字號:
/*******************************************************************************
*
* 電子科技大學嵌入式軟件工程中心、北京科銀京成技術有限公司 版權所有
*
* Copyright (C) 2000-2008 UESTC' ESEC,CoreTek Systems Inc. All Rights Reserved.
******************************************************************************/
/*
* $Log:應用程序啟動主文件 文件名 ,v$
*
* Revision 0.1 日期 時間 系統自動創建
* 創建本文件
*/
/**
* @file 文件名
* @brief
* <li>功能: </li>
* <li>設計思想:</li>
* <p>
* 注:注意事項,可以沒有。
* </p>
* @author 作者
* @date 2005-12-01
* <p>部門:所屬部分或者項目組
*/
/**************************** 引用部分 *****************************************/
#include "W90P710_BSP.H"
#include "w90p710_aic.h"
#include "w90p710_uart_int.h"
#include "w90p710_keypad_int.h"
/**************************** 定義部分 *****************************************/
/**************************** 聲明部分 *****************************************/
/**************************** 實現部分 *****************************************/
/**
* @brief
* main()函數,應用程序入口函數。
* @param[in] 無。
* @return 操作成功返回0;\n
* 出現問題返回1;
*/
#define MAX_CHAR_NUM 255
extern void CPSR_Init(void);
int main()
{
T_UART_PORT uartPort0 = UART_PORT0;
unsigned char myChar=0, key1=0, key2=0;
unsigned char myString[MAX_CHAR_NUM];
Uart_Int_Init(uartPort0);
W90P710_AIC_EnableInt(W90P710_UART_INT0);
CPSR_Init();
//函數Uart_PutString()
Uart_Int_PutString(uartPort0,"\r\n畢業設計:2406203004 李友福\r\n");
Uart_Int_PutString(uartPort0,"\r\n串口測試\r\n");
Uart_Int_Sync(uartPort0);
//函數Uart_PutLine()
Uart_Int_PutLine(uartPort0,"\r\n歡迎使用W90P710嵌入式學習板");
Uart_Int_Sync(uartPort0);
//函數Uart_PutChar()
Uart_Int_PutString(uartPort0,"\r\nThis is Port");
Uart_Int_PutChar(uartPort0,'0');
Uart_Int_PutString(uartPort0,"\r\n");
Uart_Int_Sync(uartPort0);
//函數Uart_GetChar()
Uart_Int_PutString(uartPort0,"\r\nThis is Port %d, put a char: ",uartPort0);
Uart_Int_Sync(uartPort0);
myChar = Uart_Int_GetChar(uartPort0);
Uart_Int_PutString(uartPort0,"\r\nYou have just inputed:\t%c\r\n",myChar);
Uart_Int_Sync(uartPort0);
//函數Uart_GetString(),回顯輸入的字符
//將第三個參數設置為false,則輸入的字符不再終端上顯示
Uart_Int_PutString(uartPort0,"Please input something:\t");
Uart_Int_Sync(uartPort0);
Uart_Int_GetString(uartPort0,myString,true);
Uart_Int_PutString(uartPort0,"\r\nYou have just inputed:\t%s\r\n",myString);
Uart_Int_Sync(uartPort0);
Uart_Int_Delay(uartPort0,5);
Uart_Int_Sync(uartPort0);
//鍵盤
KeyPad_Int_Init();
W90P710_AIC_EnableInt(W90P710_KPI_INT);
Uart_Int_PutLine(uartPort0,"\r\n畢業設計:2406203004 李友福\r\n");
Uart_Int_PutString(uartPort0,"\r\n鍵盤測試\r\n");
Uart_Int_Sync(uartPort0);
while(1)
{
//函數KeyPad_GetAddress()
Uart_Int_PutLine(uartPort0,"\r\nPlease Press any key on the KeyPad");
Uart_Int_Sync(uartPort0);
key1 = KeyPad_Int_GetAddress();
Uart_Int_PutLine(uartPort0,"You have just pressed a key on the keypad.");
Uart_Int_Sync(uartPort0);
Uart_Int_PutLine(uartPort0,"Row \t-> %d",((key1 & 0x78)>>3));
Uart_Int_PutLine(uartPort0,"Colume \t-> %d",(key1 & 0x07));
Uart_Int_Sync(uartPort0);
//函數KeyPad_GetKey()
Uart_Int_PutLine(uartPort0,"\r\nPlease Press any key on the KeyPad");
Uart_Int_Sync(uartPort0);
key2 = KeyPad_Int_GetKey();
Uart_Int_PutLine(uartPort0,"You have just pressed a key on the keypad.");
Uart_Int_PutLine(uartPort0,"\r\nThe key code is: \t%d",key2);
Uart_Int_Sync(uartPort0);
}
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -