EVM6418 Dip Switch Module
The following list summarizes the DIP Switch API in terms of its function calls:
EVM6418_DIP_init()
Description
Initialize the DIP switch module, must be called before any DIP switch functions.
Required Headers
evm6418.h
evm6418_dip.h
Required Libraries
evm6418bsl.lib
Function Prototype
void EVM6418_DIP_init( )
Parameters
None
Return Value
None
Example
/* Initialize the DIP switch module */
EVM6418_DIP_init();
EVM6418_DIP_get()
Description
Read the value of a DIP switch
Required Headers
evm6418.h
evm6418_dip.h
Required Libraries
evm6418bsl.lib
Function Prototype
Uint32 EVM6418_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 (EVM6418_DIP_get(2) == 0)
{
/* DIP switch 2 is on */
} else
{
/* DIP switch 2 is off */
}
|