URL
https://opencores.org/ocsvn/aemb/aemb/trunk
Subversion Repositories aemb
[/] [aemb/] [trunk/] [sw/] [vpio/] [vpioGpio.hh] - Rev 196
Go to most recent revision | Compare with Previous | Blame | View Log
/* $Id: memtest.hh,v 1.8 2008-06-24 10:03:41 sybreon Exp $
**
** VIRTUAL PERIPHERAL I/O LIBRARY
** Copyright (C) 2009 Shawn Tan <shawn.tan@aeste.net>
**
** This file is part of AEMB.
**
** AEMB is free software: you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** AEMB is distributed in the hope that it will be useful, but WITHOUT
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
** or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
** License for more details.
**
** You should have received a copy of the GNU General Public License
** along with AEMB. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
GPIO C++ Interface.
@file vpioGpio.hh
This file provides a C++ wrapper class to the low-level C interface.
*/
#ifndef VPIO_GPIO_HH
#define VPIO_GPIO_HH
#ifdef __cplusplus
extern "C" {
#endif
#include "vpioGpio.h"
#ifdef __cplusplus
}
#endif
/*!
General-Purpose I/O Class.
This is a C++ wrapper class around the low-level C code.
*/
class vpioGpioClass : public vpioGpioRegs
{
private:
//vpioGpioClass(const vpioGpioClass&);
//vpioGpioClass();
vpioGpioClass& operator=(const vpioGpioClass&);
public:
//void IniPort(int base_addr) { this = (vpioGpioRegs*)base_addr; }
void SetBit(int bit) { vpioGpioSetBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioSetBit
void ClrBit(int bit) { vpioGpioClrBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioClrBit
void TogBit(int bit) { vpioGpioTogBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioTogBit
int GetBit(int bit) { return vpioGpioGetBit( (vpioGpioRegs*)this, bit); } ///< @see vpioGpioGetBit
// Port Manipulation
void CfgPort(int mask) { vpioGpioCfgPort( (vpioGpioRegs*)this, mask); } ///< @see vpioGpioCfgPort
void PutPort(int data) { vpioGpioPutPort( (vpioGpioRegs*)this, data); } ///< @see vpioGpioPutPort
void ClrPort() { vpioGpioClrPort( (vpioGpioRegs*)this ); } ///< @see vpioGpioClrPort
int GetPort() { return vpioGpioGetPort( (vpioGpioRegs*)this ); } ///< @see vpioGpioGetPort
};
#endif
Go to most recent revision | Compare with Previous | Blame | View Log