Zilog ZUSBOPTS Manual do Utilizador Página 210

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
Vista de página 209
Run-Time Library UM017105-0511
182
Zilog Developer Studio II – ZNEO™
User Manual
Before using the getch function, the init_uart() function must be called to initialize
and select the UART. The default UART is _UART0.
init_uart
The init_uart function is a Zilog function that selects the specified UART and initial-
izes it for specified settings and returns the error status.
Synopsis
#include <sio.h>
int init_uart(int port, unsigned long freq, unsigned long
baud);
Returns
Returns 0 if initialization is successful and 1 otherwise.
Example
#include <stdio.h>
#include <sio.h>
void main()
{
init_uart(_UART0,_DEFFREQ,_DEFBAUD);
printf("Hello UART0\n"); // Write to _UART0
}
_DEFFREQ
is automatically set from the IDE using the setting in the Configure Target
dialog box. See Setup
on page 76.
kbhit
kbhit is a Zilog function that determines whether there is receive data available on the
selected UART.
Synopsis
#include <sio.h>
int kbhit(void);
Returns
Returns 1 if there is receive data available on the selected UART; otherwise, it returns 0.
Example
int i;
i=kbhit();
Note:
Vista de página 209
1 2 ... 205 206 207 208 209 210 211 212 213 214 215 ... 519 520

Comentários a estes Manuais

Sem comentários