#ifndef __SN32F780_EBI_FLASH_H
#define __SN32F780_EBI_FLASH_H

/*_____ I N C L U D E S ____________________________________________________*/
#include <stdint.h>
#include <SN32F700_Def.h>
#include <SN32F780.h>

/*_____ D E F I N I T I O N S ______________________________________________*/

/*_____ M A C R O S ________________________________________________________*/
//Flash control reset pin
#define	SET_RST_PIN_OUTPUT_LOW	 	SET_RST_PIN_OUTPUT	SET_RST_PIN_HIGH
#define	SET_RST_PIN_OUTPUT			 	SN_GPIO2->MODE_b.MODE11 = 1;
#define	SET_RST_PIN_LOW						SN_GPIO2->DATA_b.DATA11 = 0;
#define	SET_RST_PIN_HIGH					SN_GPIO2->DATA_b.DATA11 = 1;

/*_____ D E C L A R A T I O N S ____________________________________________*/
void EBI_Flash_ChipErase(uint32_t);
void EBI_Flash_SectorErase(uint32_t, uint32_t);
uint8_t EBI_Flash_BlankCheck(uint32_t, uint32_t, uint32_t);
void EBI_Flash_Program(uint32_t, uint32_t, uint32_t);
uint8_t EBI_Flash_Verify(uint32_t, uint32_t, uint32_t);

#endif	/*__SN32F780_EBI_FLASH_H*/
