YGV642_SPI_Flash.c 1.49 KB
Newer Older
崔立宝's avatar
崔立宝 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
/* 
 *	SPI Flash Memory support functions
 *
 *	Copyright(c) 2011 Yamaha Corporation
 */

#include "YGV642_SPI_Flash_IS25LP256D.h"
#include "YGV642_SPI_Flash_S25FL256S.h"
#include "YGV642_SPI_Flash_W25Q256FV.h"
#include "YGV642_SPI_Flash_W25Q128FV.h"
#include "YGV642_SPI_Flash_GD25Q127C.h"

/*------------------------------------------------------------------------------*/
/* Function name    : YGV642_Pattern_Memory_Init                                */
/* Contents         : Initialize Pattern Memory                                 */
/* Argument         : void                                                      */
/* Return value     : TRUE or FALSE                                             */
/*------------------------------------------------------------------------------*/
void YGV642_Pattern_Memory_Init(void)
{
  for (;;)
  {
    #ifdef USE_ISSI_IS25LP256D
    if (PM_IS25LP256D_ID_Check())
    {
      PM_IS25LP256D_Init();
      return;
    }
    #endif
    
    #ifdef USE_SPANSION_S25FL256S
    if (PM_S25FL256S_ID_Check())
    {
      PM_S25FL256S_Init();
      return;
    }
    #endif
    
    #ifdef USE_WINBOND_W25Q256FV
    if (PM_W25Q256FV_ID_Check())
    {
      PM_W25Q256FV_Init();
      return;
    }
    #endif
    
    #ifdef USE_WINBOND_W25Q128FV
    if (PM_W25Q128FV_ID_Check())
    {
      PM_W25Q128FV_Init();
      return;
    }
    #endif
    
    #ifdef USE_GIGADEVICE_GD25Q127C
    if (PM_GD25Q127C_ID_Check())
    {
      PM_GD25Q127C_Init();
      return;
    }
    #endif
  }
}