Embedded Systems October 2000 Vol13_11

Issue link:

Contents of this Issue


Page 127 of 181

i I LISTING 5 Sampling digital input ports /************************************* * Define structure to hoLd digitaL inputs *************************************/ struct debounceddigitaLstruct { U8 timer[BJ; U8 vaLue; }DebouncedDigitaL; 1************************************* * SampLe DigitaL Input port * Assumes that aLL B pins are inputs *************************************/ void SampLeOigitaLInputs(void) { U8 RawOigitaL = Port1; DebounceDigitaL(RawOigitaL, &DebouncedDigitaL); } sampLe compLete port and debounce aLL B inputs . One time deve/ojnnent • Classify the types of I/O that your organization uses • Defin e type definition s for configu- rations of each type. Defin e a RAM type for data that changes and a ROM type [or constant data • Defin e macros to create ROM and RAM variables for each I/O • Create rOll tines to access, sample, and drive I/O i ntegration into ajJjJ/ication • Create each instance of the input or output in a configuration fil e • Include the I/O fil es in your build SClipLS/ makefi les • Include the io.h fil e in any applica- tion module Lhat accesses I/ O • Use the names defin ed in the con- figu ra tion f.ile to access the I/O in each application module • Schedule the sampling and driving tasks in your system. This is the only You Choose the Operating System. You Choose the Single Board Computer. We 00 the Rest. B!:~m 1.888.941 .2224 • ~386EX '" Could this get any easier? Hardware and software integration provided by Arcom Controls ) ONX~ Windows NT Embedded~ Windows CE" 3.0

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems October 2000 Vol13_11