WinSystems EBC-LP Operation Manual page 83

Small, high-performance, embeddable computer system on a single board
Table of Contents

Advertisement

/* POLL.C
Copyright 1996-2001 by WinSystems Inc.
Permission is hereby granted to the purchaser of the WinSystems
UIO cards and CPU products incorporating the UIO device, to distribute
any binary file or files compiled using this source code directly or
in any work derived by the user from this file. In no case may the
source code, original or derived from this file, be distributed to any
third party except by explicit permission of WinSystems. This file is
distributed on an "As-is" basis and no warranty as to performance,
fitness of purposes, or any other warranty is expressed or implied.
In no case shall WinSystems be liable for any direct or indirect loss
or damage, real or consequential resulting from the usage of this
source code. It is the user's sole responsibility to determine
fitness for any considered purpose.
*/
#include <stdio.h>
#include <conio.h>
#include "uio48.h"
#define BASE_PORT 0x120
/* This program uses the edge detection interrupt capability of the
WS16C48 to count transitions on the first 24 lines. It does this
however, no by using true interrupts but by polling for transitions
using the get_int() function.
*/
/* Our transition totals are stored in this array */
unsigned int_counts[25];
/* Definitions for local functions */
void check_ints(void);
void main()
{
int x;
/* Initialize the I/O ports.
init_io(BASE_PORT);
/* Initialize our transition counts, and enable falling edge
transition interrupts.
*/
for(x=1; x<25; x++)
{
int_counts[x] = 0;
enab_int(x,FALLING);
Set all I/O pins to input */
/* Clear the counts */
/* Enable the falling edge interrupts */

Advertisement

Table of Contents
loading

Table of Contents