Turnstone Operating System
Loading...
Searching...
No Matches
ports.xx.c File Reference

port communication More...

#include <ports.h>

Functions

 MODULE ("turnstone.kernel.hw.io.com")
 
uint8_t serial_received (uint16_t port)
 checks data present at port More...
 
uint8_t is_transmit_empty (uint16_t port)
 checks data can be sended More...
 
void init_serial (uint16_t port)
 setups serial port More...
 
uint8_t read_serial (uint16_t port)
 reads one byte from serial port More...
 
void write_serial (uint16_t port, uint8_t data)
 writes one byte to serial port More...
 

Detailed Description

port communication

the functions inside this file are for port communication. the in/out functions defined at header file as inline functions.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ init_serial()

void init_serial ( uint16_t  port)

setups serial port

Parameters
[in]portport to setups

◆ is_transmit_empty()

uint8_t is_transmit_empty ( uint16_t  port)

checks data can be sended

Parameters
[in]portport to check
Returns
0 if data can be sended, else 1

it uses control port offset at +5 to check data can be sended.

◆ read_serial()

uint8_t read_serial ( uint16_t  port)

reads one byte from serial port

Parameters
[in]portport to read
Returns
readed value

◆ serial_received()

uint8_t serial_received ( uint16_t  port)

checks data present at port

Parameters
[in]portport to check
Returns
0 if no data, else 1

it uses control port offset at +5 to check data.

◆ write_serial()

void write_serial ( uint16_t  port,
uint8_t  data 
)

writes one byte to serial port

Parameters
[in]portport to write
[in]datadata value to be writen