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

Subversion Repositories s6soc

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

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
};
59
 
60
class   TTYCOMMS : public LLCOMMSI {
61
public:
62
        TTYCOMMS(const char *dev);
63
};
64
 
65
class   NETCOMMS : public LLCOMMSI {
66
public:
67
        NETCOMMS(const char *dev, const int port);
68
};
69
 
70
#endif

powered by: WebSVN 2.1.0

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