主题:测试程序 共有29040人关注过本帖 |
---|
jj |
1楼 |
测试程序 Post By:2010-1-23 14:52:00 [只看该作者]
// EM9000_P4_Test_EX.cpp : Defines the entry point for the application.
// #include "stdafx.h" #include "em9000_dio_Ex.h" //                   EnBits各比特位与EM9000各位GPIO的对应关系如下:  //                   ------------------------------------------------- //                      输入参数     |  对应GPIO    |  EM9000老定义  //                   ------------------------------------------------- //                      EnBits.D0    |    GPIO0     |   P5.0 / SA5 //                      EnBits.D1    |    GPIO1     |   P5.1 / SA6 //                      EnBits.D2    |    GPIO2     |   P5.2 / SA7 //                      EnBits.D3    |    GPIO3     |   P5.3 / SA8 //                      EnBits.D4    |    GPIO4     |   P5.4 / SA9 //                      EnBits.D5    |    GPIO5     |   P5.5 / SA10 //                      EnBits.D6    |    GPIO6     |   P5.6 / SA11 //                      EnBits.D7    |    GPIO7     |   P5.7 / SA12 //                      EnBits.D8    |    GPIO8 |   P4.0 / IRQ1 //                      EnBits.D9    |    GPIO9 |   P4.1 //                      EnBits.D10   |    GPIO10 |   P4.2 //                      EnBits.D11   |    GPIO11    |   P4.3 //                      EnBits.D12   |    GPIO12    |   P3.2 / CS0# //                      EnBits.D13   |    GPIO13    |   P2.3 //                      EnBits.D14   |    GPIO14    |   P2.4 //                      EnBits.D15   |    GPIO15 |   P2.5 //                   ------------------------------------------------- // #define   P4_1  0x200 #define   P2_3  0x2000 #define   P2_4  0x4000 #define   P2_5  0x8000 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR    lpCmdLine, int       nCmdShow) {   // TODO: Place code here. printf("EM9000 GPIO Test with EX V1!\n"); //PIO_OutEnable(P4_1); PIO_OutEnable(P2_3); //PIO_OutEnable(P2_4); //PIO_OutEnable(P2_5); while(1) { //PIO_OutSet(P4_1); //PIO_OutSet(P2_3); PIO_OutSet(P2_4); //PIO_OutSet(P2_5); Sleep(1000); Sleep(1000); //PIO_OutClear(P4_1); //PIO_OutClear(P2_3); PIO_OutClear(P2_4); //PIO_OutClear(P2_5); Sleep(1000); Sleep(1000); } return 0; } 请问我在EM9000的P2.4和地之间接了发光二极管,为什么运行这个程序后发光二极管一直亮呢?程序没起到作用啊! |
|
单帖管理 | 引用 | 回复 |
x10 |
2楼 |
Post By:2010-1-23 20:58:00 [只看该作者]
不应当的,我们上班后再做测试。
|
|
单帖管理 | 引用 | 回复 |