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

Subversion Repositories aemb

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

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 197 sybreon
namespace vpio {
41
 
42 196 sybreon
/*!
43
   General-Purpose I/O Class.
44
 
45
   This is a C++ wrapper class around the low-level C code.
46
*/
47
 
48 197 sybreon
class gpioClass : public gpioRegs
49 196 sybreon
{
50
 
51
private:
52
 
53 197 sybreon
  //gpioClass(const gpioClass&);
54
  //gpioClass();
55
  gpioClass& operator=(const gpioClass&);
56 196 sybreon
 
57
public:
58
 
59 197 sybreon
  //void IniPort(int base_addr) { this = (gpioRegs*)base_addr; }
60 196 sybreon
 
61 197 sybreon
  void SetBit(gpioData bit) { gpioSetBit( (gpioRegs*)this, bit); } ///< @see gpioSetBit
62
  void ClrBit(gpioData bit) { gpioClrBit( (gpioRegs*)this, bit); } ///< @see gpioClrBit
63
  void TogBit(gpioData bit) { gpioTogBit( (gpioRegs*)this, bit); } ///< @see gpioTogBit
64
  gpioData  GetBit(gpioData bit) { return gpioGetBit( (gpioRegs*)this, bit); } ///< @see gpioGetBit
65 196 sybreon
 
66
  // Port Manipulation
67 197 sybreon
  //void PutTris(gpioData mask) { gpioPutTris( (gpioRegs*)this, mask); } ///< @see gpioPutTris
68
  void SetTris(gpioData mask) { gpioSetTris( (gpioRegs*)this, mask); } ///< @see gpioSetTris
69
  void PutData(gpioData data) { gpioPutData( (gpioRegs*)this, data); } ///< @see gpioPutData
70
  //void ClrPort() { gpioClrPort( (gpioRegs*)this ); } ///< @see gpioClrPort
71
  //gpioData GetTris() { return gpioGetTris( (gpioRegs*)this ); } ///< @see gpioGetTris
72
  gpioData GetData() { return gpioGetData( (gpioRegs*)this ); } ///< @see gpioGetData
73 196 sybreon
 
74 197 sybreon
  void Init() { gpioInit( (gpioRegs*)this ); } ///< @see gpioInit
75 196 sybreon
};
76
 
77 197 sybreon
}
78
 
79 196 sybreon
#endif

powered by: WebSVN 2.1.0

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