OpenCores
URL https://opencores.org/ocsvn/s6soc/s6soc/trunk

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [bench/] [cpp/] [uartsim.h] - Blame information for rev 18

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dgisselq
//
2
//
3
// Filename:    uartsim.h
4
//
5
// Project:     FPGA library development (S6 development board)
6
//
7
// Purpose:     To emulate the external parameters of a UART device, providing
8
//              the UART output to, and input from, the command
9
//              console/terminal while also providing the controller with
10
//              appropriate busy lines as necessary.
11
//
12
// Creator:     Dan Gisselquist
13
//              Gisselquist Tecnology, LLC
14
//
15
// Copyright:   2016
16
//
17
//
18
#include <unistd.h>
19
 
20
class   UARTSIM {
21
private:
22
        int     m_tx_busy_count, m_baud_counts, m_rx_busy_count;
23
        int     m_fdin, m_fdout;
24
        char    m_rx_next, m_tx_data;
25
 
26
public:
27
        UARTSIM(int baud_counts, int fdin = STDIN_FILENO,
28
                        int fdout=STDOUT_FILENO);
29
        int     rx(unsigned char &data);
30
        int     tx(int stb, char data);
31
};
32
 
33
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.