Site Index
   Home
   File Upload
Google

Transfer Site
Main Site

EVM5502 Dip Switch Module

The following list summarizes the DIP Switch API in terms of its function calls:

Function Description
EVM5502_DIP_init Initialize the DIP switches
EVM5502_DIP_get Read the value of a DIP switch

EVM5502_DIP_init()

Description
Initialize the DIP switch module, must be called before any DIP switch functions.

Required Headers
evm5502.h
evm5502_dip.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_DIP_init( )

Parameters
None

Return Value
None

Example

    /* Initialize the DIP switch module */
    EVM5502_DIP_init();

EVM5502_DIP_get()

Description
Read the value of a DIP switch

Required Headers
evm5502.h
evm5502_dip.h

Required Libraries
evm5502bsl.lib

Function Prototype
Uint32 EVM5502_DIP_get(Uint32 dipNum)

Parameters
dipNum Index of the switch to read. dipNum ranges from 0 to 3.

Return Value
0 Specified switch is on (switch is depressed).
1 Specified switch is off (switch is in up position).

Example

    /* Check the value of DIP switch 2 */
    if (EVM5502_DIP_get(2) == 0)
    {
        /* DIP switch 2 is on */
    } else
    {
        /* DIP switch 2 is off */
    }
©Copyright 2002-2011 Spectrum Digital, Inc. All Rights Reserved.