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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [vpio/] [vpioGpio.hh] - Blame information for rev 196

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

Line No. Rev Author Line
1 196 sybreon
/* $Id: memtest.hh,v 1.8 2008-06-24 10:03:41 sybreon Exp $
2
**
3
** VIRTUAL PERIPHERAL I/O LIBRARY
4
** Copyright (C) 2009 Shawn Tan 
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU General Public License as published by
10
** the Free Software Foundation, either version 3 of the License, or
11
** (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16
** License for more details.
17
**
18
** You should have received a copy of the GNU General Public License
19
** along with AEMB.  If not, see .
20
*/
21
 
22
/*!
23
  GPIO C++ Interface.
24
  @file vpioGpio.hh
25
 
26
  This file provides a C++ wrapper class to the low-level C interface.
27
 */
28
 
29
#ifndef VPIO_GPIO_HH
30
#define VPIO_GPIO_HH
31
 
32
#ifdef __cplusplus
33
extern "C" {
34
#endif
35
#include "vpioGpio.h"
36
#ifdef __cplusplus
37
}
38
#endif
39
 
40
/*!
41
   General-Purpose I/O Class.
42
 
43
   This is a C++ wrapper class around the low-level C code.
44
*/
45
 
46
class vpioGpioClass : public vpioGpioRegs
47
{
48
 
49
private:
50
 
51
  //vpioGpioClass(const vpioGpioClass&);
52
  //vpioGpioClass();
53
  vpioGpioClass& operator=(const vpioGpioClass&);
54
 
55
public:
56
 
57
  //void IniPort(int base_addr) { this = (vpioGpioRegs*)base_addr; }
58
 
59
  void SetBit(int bit) { vpioGpioSetBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioSetBit
60
  void ClrBit(int bit) { vpioGpioClrBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioClrBit
61
  void TogBit(int bit) { vpioGpioTogBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioTogBit
62
  int  GetBit(int bit) { return vpioGpioGetBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioGetBit
63
 
64
  // Port Manipulation
65
  void CfgPort(int mask) { vpioGpioCfgPort( (vpioGpioRegs*)this, mask); } ///< @see vpioGpioCfgPort
66
  void PutPort(int data) { vpioGpioPutPort( (vpioGpioRegs*)this, data); } ///< @see vpioGpioPutPort
67
  void ClrPort() { vpioGpioClrPort( (vpioGpioRegs*)this ); } ///< @see vpioGpioClrPort
68
  int  GetPort() { return vpioGpioGetPort( (vpioGpioRegs*)this ); } ///< @see vpioGpioGetPort
69
 
70
};
71
 
72
#endif

powered by: WebSVN 2.1.0

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