home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_12 / 8n12037a < prev    next >
Text File  |  1990-10-17  |  644b  |  27 lines

  1.  
  2.         /* clear bit 3 in the data direction register */
  3.         /* to make line 3 (from device 1) in the general */
  4.         /* purpose I/O register an input line.  Just for */
  5.         /* fun, do it four different, but equivalent, ways. */
  6.  
  7.  
  8. #include "mfp_defs.h"           /* MFP address definitions */
  9. #include "mfp_macs.h"           /* MFP macro definitions */
  10.  
  11. #define BIT3_MASK  0xf7         /* mask for clearing bit 3 */
  12.  
  13.  
  14. dev_input()
  15. {
  16.         *(unsigned char *)DDR &= BIT3_MASK;
  17.  
  18.         REGVAL(DDR) &= BITOFF_MASK(DEVICE_1);
  19.  
  20.         CLR_BITS(DDR,BITOFF_MASK(DEVICE_1));
  21.  
  22.         BIT_CLR(DDR,DEVICE_1);
  23. }
  24.  
  25.  
  26.  
  27.