#include "ip445.h" /* {+D} SYSTEM: Acromag IP445 Digital I/O Board FILENAME: wprt445.c MODULE NAME: wprt445() - write output port VERSION: A CREATION DATE: 05/19/98 CODED BY: FJM ABSTRACT: This module writes output values to a single I/O port. CALLING SEQUENCE: status = wprt445(map_ptr, port, value); where: status (long) The returned error status. map_ptr (pointer to structure) Pointer to the board memory map. port (unsigned) The target I/O port number. value (byte) The output value. MODULE TYPE: long I/O RESOURCES: SYSTEM RESOURCES: MODULES CALLED: REVISIONS: DATE BY PURPOSE -------- ----- --------------------------------------------------- {-D} */ /* MODULES FUNCTION DETAILS This module writes a 8-bit hex output value (from 00 to FF) to an I/O port. The valid value of "port" is from 0 to 3. Otherwise, a -1 is returned. */ long wprt445(map_ptr, port, value) struct map445 *map_ptr; /* address of board memory map */ unsigned port; /* the I/O port number */ byte value; /* the output value */ { /* ENTRY POINT OF ROUTINE */ printf("Testing1"); if (port > 3 ) /* error checking */ return(-1); else { output_byte((byte*)&map_ptr->io_map[port].io_port, value); } return(0); }