/******************************************************************
* Copyright (C) 2009 Ram Narula
* Filename: doGPIO.h
* Version: 0.1
* Date: 14 July 2009
* Information: http://www.xduino.com/
******************************************************************/
/******************************************************************
* This file is part of Xduino
*
* Xduino is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xduino 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Xduino. If not, see .
******************************************************************/
// load this library only once
#ifndef doGPIO_h
#define doGPIO_h
// GPIO interfacing creation and manipulation of GPIO Pin objects
class doGPIO
{
public:
// variables
int error;
u16 GPIOPin;
GPIOMode_TypeDef GPIOMode;
// methods
doGPIO(GPIO_TypeDef* GPIObank_, u16 GPIOPinNumber_, GPIOMode_TypeDef GPIOMode_);
void High(void);
void Low(void);
void Toggle(void);
bool Read(void);
private:
// variables
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_TypeDef* GPIObank;
};
#endif