?? test_led8x8.c
字號:
/****************************************************************************
【文 件 名 稱】Test_LED8X8.C
【功 能 描 述】三星S3C2410A板demo程序代碼
【程 序 版 本】4.0
【創建人及創建日期】icesoar//2002年11月19日19:26
【修改人及修改日期】icesoar//2004-12-8 17:25
****************************************************************************/
//***************************************************************************
#include "def.h"
#include "2410addr.h"
#include "config.h"
#include "board.h"
#include "utils.h"
//***************************************************************************
#define LED8X8_Address *(volatile U16 *)( 0x080001000 ) //nGCS1
U16 LED8X8_Disp1[8] = { 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa } ; /*定義特定的顯示數組*/
U16 LED8X8_Disp2[8] = { 0xff,0x81,0xbd,0xa5,0xa5,0xbd,0x81,0xff } ; /*定義特定的顯示數組*/
U16 LED8X8_Disp3[8] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff } ; /*定義特定的顯示數組*/
//***************************************************************************
/****************************************************************************
【功能說明】步進電機實驗程序
****************************************************************************/
void LED8X8_Display( U16 *LED8X8, U32 d )
{
U16 m ;
while( d-- )
{
for( m = 0; m < 8; m++ )
{
LED8X8_Address = ( (1<<(8+m))&0xff00 ) | ( (~LED8X8[m]) & 0x00ff ) ;
Delay( 2 ) ;
}
}
}
/****************************************************************************
【功能說明】步進電機實驗程序
****************************************************************************/
void Test_LED8X8(void)
{
printf( "S3C2410A 8X8 LED 點陣顯示實驗, press ESC key to exit !\n" ) ;
while( getkey() != ESC_KEY )
{
LED8X8_Display( LED8X8_Disp1, 30 ) ;
LED8X8_Display( LED8X8_Disp2, 30 ) ;
LED8X8_Display( LED8X8_Disp3, 30 ) ;
}
LED8X8_Address = 0xffff ; //關閉LED點陣的顯示
}
static char title[] = "8X8 LED點陣實驗";
static char tip[] = "實驗8X8 LED點陣,按ESC鍵返回";
//Test_LED8X8Item在prog_entry.c里被引用
TEST_PROGRAM_ITEM Test_LED8X8Item = {
(TEST_PROGRAM)Test_LED8X8, //入口地址
title, //顯示名稱
tip, //幫助或提示信息,可為NULL
1}; //使用printf,puts,putch等函數時在LCD上也顯示輸出字符(串)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -