#ifndef STM32F4FMC_HPP
#define STM32F4FMC_HPP

#ifdef __cplusplus
extern "C"{
#endif
	
#include "stm32f4xx.h"
	
#ifdef __cplusplus
}
#endif

/**
* Pinout summary for FMC interface in 8080 16-bit IF
*/
/** FMC GPIO Configuration  
PF0   ------> FMC_A0 (DC)
PE7   ------> FMC_D4
PE8   ------> FMC_D5
PE9   ------> FMC_D6
PE10  ------> FMC_D7
PE11  ------> FMC_D8
PE12  ------> FMC_D9
PE13  ------> FMC_D10
PE14  ------> FMC_D11
PE15  ------> FMC_D12
PD8   ------> FMC_D13
PD9   ------> FMC_D14
PD10  ------> FMC_D15
PD14  ------> FMC_D0
PD15  ------> FMC_D1
PD0   ------> FMC_D2
PD1   ------> FMC_D3
PD4   ------> FMC_NOE (RD#)
PD5   ------> FMC_NWE	(WR#)
PG9   ------> FMC_NE2 (CS#)
*/

#define LCD_FMC_ADDR			((uint32_t)0x64000000)	//bank2 address for FMC SRAM
#define LCD_FMC_BANK			FMC_Bank1_NORSRAM2			//hardware specific with NE2 wired to CS# of 8080 LCD controller
#define LCD_DC_CMD   			((uint32_t)0x00)				//DC line (FMC_A0(PF0)) for 8080-mode LCD
#define LCD_DC_DATA				((uint32_t)0x02)	

#define writeData(ui16Data)			*(__IO uint16_t*) (LCD_FMC_ADDR + LCD_DC_DATA) = ui16Data
#define writeCmd(ui16Cmd)				*(__IO uint16_t*) (LCD_FMC_ADDR + LCD_DC_CMD) = ui16Cmd	

/**
* @class STM32F4FMC
* @brief Interface for FMC module of SMT32F4
*/
class STM32F4FMC
{
public:
	virtual void init();
	virtual ~STM32F4FMC()
	{
	}
};
#endif
