cplddemo.c

来自「sharp的arm920t 7A400的评估板附带光盘Sharp KEVLH7A」· C语言 代码 · 共 46 行

C
46
字号
 /*****************************************************************************
 *	$Workfile:   cplddemo.c  $
 *	$Revision:   1.0  $
 *	$Author:   WellsK  $
 *	$Date:   Sep 22 2002 10:59:38  $
 *
 *	Project: CPLD pushbutton/7-segment example
 *
 *	Description:
 *    This demo simply reads the pushbutton switch state and outputs the
 *    binary value for the state on the 7-segment displays.
 *
 *	Revision History:
 *	$Log:   //smaicnt2/pvcs/VM/CDROM/archives/KEV7A400/Software/Examples/cplddemo/cplddemo.c-arc  $
 * 
 *    Rev 1.0   Sep 22 2002 10:59:38   WellsK
 * Initial revision.
 * 
 * 
 *	COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
 *		CAMAS, WA
 ****************************************************************************/

#include "SMA_types.h"
#include "LH7A400_EVB_CPLD_driver.h"
#include "SMA_sevenseg_driver.h"

int main (void)
{
    volatile INT_32 pb;
    INT_32 i;

    // Endless loop, stop this program from the debugger
    while (1)
    {
        // Read switch state and put raw binary value on 7-seg displays
        pb = (INT_32) LH7A400_pld_get_pb ();
        util_set_sevenseg_hexval (pb, 0);

        // This small loop prevents the bus from getting hammered
        for (i = 0; i < 1000; i++);
    }

    return 1;
 }
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?