#ifndef __GPIO_REGISTERS_H__
#define __GPIO_REGISTERS_H__

#include <stdint.h>
#include "platform.h"

namespace GPIO
{
	static const uint32_t BaseAddress = (KS8695PX_IO_BASE + KS8695PX_GPIO_OFFSET);
	
	enum Registers
	{
		IOPM	= 0x0000,		// 0x00	- IO Port Mode (rw) 
		IOPC	= 0x0004,		// 0x04	- IO Port Control (rw)
		IOPD	= 0x0008		// 0x08 - IO Port Data
	};
	
	inline volatile uint32_t *regAddress(Registers reg)
	{
	    return reinterpret_cast<volatile uint32_t*>(BaseAddress + reg);
	}
	
	inline uint32_t regRead(Registers reg)
	{
	    return *regAddress(reg);
	}
	
	inline void regWrite(Registers reg, uint32_t value)
	{
	    *regAddress(reg) = value;
	}

}

#endif /*GPIO_REGISTERS_H_*/
