/******************************************************************
*  Copyright (C) 2009 Ram Narula  
*  Filename: compatArduino.h
*  Version: 0.11
*  Date: 16 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 compatArduino_h
#define compatArduino_h

// Serial communication via USART/UART in classic Arduino methods
class ArdSerial
{
  public:
  // variables
  	u8 port;
	u32 Baudrate;

  // methods
	ArdSerial(u8 port_);
	void begin(u32 Baudrate_);
	void print(char *s);
	void println(char *s);
	u16 print(u16 w);
	char read(void);
	u16 getdata(void);
	bool available(void);  
	
  private:
  	
};

/*
//Retrieve GPIObank and GPIO_Pin_x
class definePin
{
  public:
  // variables
  	GPIO_TypeDef* GPIObank;
	u16 GPIOPin;

  // methods
	definePin(u8 Pxn);

  private:

};
*/

// general function protypes
void pinMode(u8 Pxn,GPIOMode_TypeDef GPIOMode);
void digitalWrite(u8 Pxn,bool data);
bool digitalRead(u8 Pxn);

#endif