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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [llcomms.h] - Blame information for rev 53

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

Line No. Rev Author Line
1 11 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    llcomms.h
4
//
5
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
6
//
7
// Purpose:     This defines a C++ interface on the command side that can
8
//              interact with 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
// Creator:     Dan Gisselquist, Ph.D.
14
//              Gisselquist Technology, LLC
15
//
16
////////////////////////////////////////////////////////////////////////////////
17
//
18
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
19
//
20
// This program is free software (firmware): you can redistribute it and/or
21
// modify it under the terms of  the GNU General Public License as published
22
// by the Free Software Foundation, either version 3 of the License, or (at
23
// your option) any later version.
24
//
25
// This program is distributed in the hope that it will be useful, but WITHOUT
26
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
27
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
28
// for more details.
29
//
30
// You should have received a copy of the GNU General Public License along
31
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
32
// target there if the PDF file isn't present.)  If not, see
33
// <http://www.gnu.org/licenses/> for a copy.
34
//
35
// License:     GPL, v3, as defined and found on www.gnu.org,
36
//              http://www.gnu.org/licenses/gpl.html
37
//
38
//
39
////////////////////////////////////////////////////////////////////////////////
40
//
41
//
42
#ifndef LLCOMMS_H
43
#define LLCOMMS_H
44
 
45
class   LLCOMMSI {
46
protected:
47
        int     m_fdw, m_fdr;
48
        LLCOMMSI(void);
49
public:
50
        unsigned long   m_total_nread, m_total_nwrit;
51
 
52
        virtual ~LLCOMMSI(void) { close(); }
53
        virtual void    kill(void)  { this->close(); };
54
        virtual void    close(void);
55
        virtual void    write(char *buf, int len);
56
        virtual int     read(char *buf, int len);
57
        virtual bool    poll(unsigned ms);
58 45 dgisselq
 
59
        // Tests whether or not bytes are available to be read, returns a 
60
        // count of the bytes that may be immediately read
61
        virtual int     available(void); // { return 0; };
62 11 dgisselq
};
63
 
64
class   TTYCOMMS : public LLCOMMSI {
65
public:
66
        TTYCOMMS(const char *dev);
67
};
68
 
69
class   NETCOMMS : public LLCOMMSI {
70
public:
71
        NETCOMMS(const char *dev, const int port);
72
};
73
 
74
#endif

powered by: WebSVN 2.1.0

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