]> wirehaze git hosting - ppos.git/blob - ppos/hardware/serial.c

wirehaze git hosting

tasks implementation (ongoing)
[ppos.git] / ppos / hardware / serial.c
1 // PingPongOS - PingPong Operating System
2 // Prof. Carlos A. Maziero, DINF UFPR
3 // Versão 2.0 -- Junho de 2025
4
5 /*
6
7 Emula operações de E/S de caracteres em uma porta serial,
8 que normalmente corresponde a um terminal de texto.
9
10 Esta implementação usando stdio é trivial, deve ser substituída
11 por uma emulação mais detalhada de uma UART (Universal Asynchronous
12 Receiver-Transmitter) gerenciando a linha serial.
13
14 */
15
16 #include <stdio.h>
17 #include "serial.h"
18
19 #define NOERROR 0
20 #define ERROR -1
21
22 //----------------------------------------------------------------------
23
24 int hw_serial_init ()
25 {
26 return(NOERROR);
27 }
28
29 //----------------------------------------------------------------------
30
31 int hw_serial_put(char c)
32 {
33 // implementação trivial, a ser substituída pela emulação da UART.
34 return(putchar(c));
35 }
36
37 //----------------------------------------------------------------------
38
39 char hw_serial_get()
40 {
41 // a ser implementado
42 return (0);
43 }
44
45 //----------------------------------------------------------------------