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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [host/] [llcomms.h] - Blame information for rev 4

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

Line No. Rev Author Line
1 4 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
//
4
// Filename:    llcomms.cpp
5
//
6
// Project:     UART to WISHBONE FPGA library
7
//
8
// Purpose:     This is the C++ program on the command side that will interact
9
//              with a UART on an FPGA, both sending and receiving characters.
10
//              Any bus interaction will call routines from this lower level
11
//              library to accomplish the actual connection to and
12
//              transmission to/from the board.
13
//
14
// Creator:     Dan Gisselquist
15
//              Gisselquist Tecnology, LLC
16
//
17
// Copyright:   2015
18
//
19
//
20
#ifndef LLCOMMS_H
21
#define LLCOMMS_H
22
 
23
class   LLCOMMSI {
24
protected:
25
        int     m_fdw, m_fdr;
26
        LLCOMMSI(void);
27
public:
28
        unsigned long   m_total_nread, m_total_nwrit;
29
 
30
        virtual ~LLCOMMSI(void) { close(); }
31
        virtual void    kill(void)  { this->close(); };
32
        virtual void    close(void);
33
        virtual void    write(char *buf, int len);
34
        virtual int     read(char *buf, int len);
35
        virtual bool    poll(unsigned ms);
36
 
37
        // Tests whether or not bytes are available to be read, returns a 
38
        // count of the bytes that may be immediately read
39
        virtual int     available(void); // { return 0; };
40
};
41
 
42
class   TTYCOMMS : public LLCOMMSI {
43
public:
44
        TTYCOMMS(const char *dev);
45
};
46
 
47
class   NETCOMMS : public LLCOMMSI {
48
public:
49
        NETCOMMS(const char *dev, const int port);
50
};
51
 
52
#endif

powered by: WebSVN 2.1.0

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