49 lines
1.5 KiB
C
49 lines
1.5 KiB
C
/*================================================================
|
|
Copyright (c) 2022, Quectel Wireless Solutions Co., Ltd. All rights reserved.
|
|
Quectel Wireless Solutions Proprietary and Confidential.
|
|
=================================================================*/
|
|
|
|
#include "ql_rtos.h"
|
|
#include "ql_type.h"
|
|
#include "ql_spi_nor.h"
|
|
#include "quec_spi_nor.h"
|
|
#include "SPI.h"
|
|
|
|
unsigned char *ql_spi_nor_read_id(int port)
|
|
{
|
|
return QUEC_SPI_NOR_ReadID(port);
|
|
}
|
|
|
|
unsigned int ql_spi_nor_init(int port, int clk)
|
|
{
|
|
return QUEC_SPI_NOR_Init(port, clk);
|
|
}
|
|
|
|
unsigned int ql_spi_nor_read(int port, unsigned char* pBuffer,unsigned int ReadAddr,unsigned short NumByteToRead)
|
|
{
|
|
return QUEC_SPI_NOR_Read(port, pBuffer, ReadAddr, NumByteToRead);
|
|
}
|
|
|
|
unsigned int ql_spi_nor_read_fifo(int port, unsigned char* pBuffer,unsigned int ReadAddr,unsigned short NumByteToRead)
|
|
{
|
|
return QUEC_SPI_NOR_Read_PIO(port, pBuffer, ReadAddr, NumByteToRead);
|
|
}
|
|
unsigned int ql_spi_nor_write(int port, unsigned char* pBuffer,unsigned int WriteAddr,unsigned short NumByteToWrite)
|
|
{
|
|
return QUEC_SPI_NOR_Write(port, pBuffer, WriteAddr, NumByteToWrite);
|
|
}
|
|
|
|
unsigned int ql_spi_nor_erase_chip(int port)
|
|
{
|
|
return QUEC_SPI_NOR_Erase_Chip(port);
|
|
}
|
|
|
|
unsigned int ql_spi_nor_erase_sector(int port, unsigned int Dst_Addr)
|
|
{
|
|
return QUEC_SPI_NOR_Erase_Sector(port, Dst_Addr);
|
|
}
|
|
|
|
void ql_spi_nor_reg_write_read(int port, unsigned char *cmd, unsigned char *data, unsigned char len)
|
|
{
|
|
//quec_spinor_reg_write_read(port,cmd,data,len);
|
|
} |