/* Read data from SPI Flash by Page Read mode.  */
void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint32_t u32RdCmd, int isSync)
/* Read data from SPI Flash by Page Read mode.  */
void SPIM_DMA_Read(uint32_t u32Addr, int is4ByteAddr, uint32_t u32NRx, uint8_t pu8RxBuf[], uint32_t u32RdCmd, int isSync)
{
    SPIM_SET_OPMODE(SPIM_CTL0_OPMODE_PAGEREAD);
    SPIM_SET_SPIM_MODE(u32RdCmd);
    SPIM_SET_4BYTE_ADDR_EN(is4ByteAddr);
    SPIM->SRAMADDR = (uint32_t) pu8RxBuf;
    SPIM->DMACNT = u32NRx;
    SPIM->FADDR = u32Addr;
    SPIM_SET_GO();
    if (isSync)
    {
        SPIM_WAIT_FREE();
    }
}