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

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [sw/] [llcomms.h] - Blame information for rev 107

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

Line No. Rev Author Line
1 5 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    llcomms.h
4
//
5
// Project:     XuLA2 board
6
//
7
// Purpose:     This is the C++ program on the command side that will interact
8
//              with a UART on an FPGA, both sending and receiving characters.
9
//              Any bus interaction will call routines from this lower level
10
//              library to accomplish the actual connection to and
11
//              transmission to/from the board.
12
//
13
//
14
// Creator:     Dan Gisselquist, Ph.D.
15
//              Gisselquist Technology, LLC
16
//
17
////////////////////////////////////////////////////////////////////////////////
18
//
19 91 dgisselq
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
20 5 dgisselq
//
21
// This program is free software (firmware): you can redistribute it and/or
22
// modify it under the terms of  the GNU General Public License as published
23
// by the Free Software Foundation, either version 3 of the License, or (at
24
// your option) any later version.
25
//
26
// This program is distributed in the hope that it will be useful, but WITHOUT
27
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
28
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
29
// for more details.
30
//
31
// License:     GPL, v3, as defined and found on www.gnu.org,
32
//              http://www.gnu.org/licenses/gpl.html
33
//
34
//
35
////////////////////////////////////////////////////////////////////////////////
36
//
37
//
38
//
39
#ifndef LLCOMMS_H
40
#define LLCOMMS_H
41
 
42
class   LLCOMMSI {
43
protected:
44
        int     m_fdw, m_fdr;
45
        LLCOMMSI(void);
46
public:
47
        unsigned long   m_total_nread, m_total_nwrit;
48
 
49
        virtual ~LLCOMMSI(void) { close(); }
50
        virtual void    kill(void)  { this->close(); };
51
        virtual void    close(void);
52
        virtual void    write(char *buf, int len);
53
        virtual int     read(char *buf, int len);
54
        virtual bool    poll(unsigned ms);
55 91 dgisselq
 
56
        // Tests whether or not bytes are available to be read, returns a 
57
        // count of the bytes that may be immediately read
58
        virtual int     available(void); // { return 0; };
59 5 dgisselq
};
60
 
61
class   TTYCOMMS : public LLCOMMSI {
62
public:
63
        TTYCOMMS(const char *dev);
64
};
65
 
66
class   NETCOMMS : public LLCOMMSI {
67
public:
68
        NETCOMMS(const char *dev, const int port);
69
};
70
 
71
#endif

powered by: WebSVN 2.1.0

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