ISD51 User's Guide

_iskey

Summary
#include "isd51.h"

bit _iskey (void);
Description

The _iskey routine is an ISD51 function that checks to see if a serial character is ready for the user program.

Note

  • To use this function in your ISD51 Applications, you must enable the ISD51 putchar and _getkey functions using the ISD_PUTCHAR and ISD_GETKEY defines in ISD51.H.
Return Value

The _iskey routine returns a value of 0 if no input character is available or a value of 1 if an input character is available.

Example
#include "isd51.h"

void main (void)
{
.
.
.
/*--------------------------------------------
Initialize the 8051 UART.
Then, initialize ISD51.
--------------------------------------------*/
Init_UART ();
ISDinit ();

while (1)
  {
  unsigned char c;

  while (!_iskey())
    {
    }

  c = _getkey();
  printf ("I got a %c\n", c);
  }
}