SPI Flash Memory API Calls

spiFlash_f2m()

Usage void spiFlash_f2m(u32 spi, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
[IN] flashAddress flash device start address
[IN] memoryAddress RAM memory start address
Description Copy data from the flash device to memory with chip select control.

spiFlash_f2m_withGpioCs()

Usage void spiFlash_f2m_withGpioCs(u32 spi, Gpio_Reg *gpio, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
[IN] flashAddress flash device start address
[IN] memoryAddress RAM memory start address
[IN] size programming address size
Description Flash device from the SPI master with GPIO chip select.

spiFlash_f2m_dual()

Usage void spiFlash_f2m_dual(u32 spi, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
[IN] flashAddress flash address to read the data
[IN] memoryAddress RAM address to write the data
[IN] size size of data to copy
Description Read data from flashAddress and copy to memoryAddress of specific size with chip select with dual data lines - half duplex.

spiFlash_f2m_dual_withGpioCs()

Usage void spiFlash_f2m_dual(u32 spi, u32 gpio, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
[IN] flashAddress flash address to read the data
[IN] memoryAddress RAM address to write the data
[IN] size size of data to copy
Description Read data from flashAddress and copy to memoryAddress of specific size with GPIO chip select with dual data lines - half duplex.

spiFlash_f2m_quad()

Usage void spiFlash_f2m_quad(u32 spi, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
[IN] flashAddress flash address to read the data
[IN] memoryAddress RAM address to write the data
[IN] size size of data to copy
Description Read data from flashAddress and copy to memoryAddress of specific size with chip select with quad data lines - half duplex. Please define DEFAULT_ADDRESS_BYTE or MX25_FLASH to support the quad data lanes.

spiFlash_f2m_quad_withGpioCs()

Usage void spiFlash_f2m_withGpioCs(u32 spi, u32 gpio, u32 cs, u32 flashAddress, u32 memoryAddress, u32 size)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
[IN] flashAddress flash address to read the data
[IN] memoryAddress RAM address to write the data
[IN] size size of data to copy
Description Read data from flashAddress and copy to memoryAddress of specific size with GPIO chip select with quad data lines - half duplex

spiFlash_diselect()

Usage void spiFlash_diselect(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description De-asserts the SPI flash device from the master chip select.

spiFlash_diselect_withGpioCs()

Usage void spiFlash_diselect_withGpioCs(u32 gpio, u32 cs)
Include driver/spiFlash.h
Parameters [IN] gpio GPIO base address
[IN] cs chip select/slaveID
Description De-asserts the SPI flash device from the master with the GPIO chip select.

spiFlash_init()

Usage void spiFlash_init(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Initialize the SPI reg struct with chip select de-asserted with the following default settings:
spiCfg.cpol = 0;
spiCfg.cpha = 0;
spiCfg.mode = 0;
spiCfg.clkDivider = 2;
spiCfg.ssSetup = 5;
spiCfg.ssHold = 2;
spiCfg.ssDisable = 7;

spiFlash_init_withGpioCs()

Usage void spiFlash_init_withGpioCs(u32 spi, u32 gpio, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
Description Initialize the SPI reg struct with GPIO chip select de-asserted with the following default settings:
spiCfg.cpol = 0;
spiCfg.cpha = 0;
spiCfg.mode = 0;
spiCfg.clkDivider = 2;
spiCfg.ssSetup = 5;
spiCfg.ssHold = 2;
spiCfg.ssDisable = 7;

spiFlash_read_id()

Usage u8 spiFlash_read_id(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Returns [OUT] 8-bit SPI flash ID
Description Read the ID from the flash with chip select.

spiFlash_select()

Usage void spiFlash_select(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Select the SPI flash device with chip select.

spiFlash_select_withGpioCs()

Usage spiFlash_select_withGpioCs(u32 gpio, u32 cs)
Include driver/spiFlash.h
Parameters [IN] gpio GPIO base address
[IN] cs chip select/slaveID
Description Select the SPI flash device with the GPIO chip select.

spiFlash_software_reset()

Usage void spiFlash_software_reset(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Reset the SPI flash with chip select.

spiFlash_wake()

Usage void spiFlash_wake(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Release power down from the SPI master with chip select.

spiFlash_wake_withGpioCs()

Usage void spiFlash_wake_withGpioCs(u32 spi, u32 gpio, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
Description Release power down from the SPI master with the GPIO chip select.

spiFlash_manufacturer_id()

Usage void spiFlash_manufacturer_id_(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Get SPI flash manufacturer ID.

spiFlash_exit4ByteAddr()

Usage void spiFlash_exit4ByteAddr(u32 spi, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] cs chip select/slaveID
Description Exit 4-byte addressing. Ensure the addressing mode is set to 3-byte before accessing the SPI Flash. Calling spiFlash_manufacturer_id_ function before exiting 4-byte addressing.

spiFlash_exit4ByteAddr_withGpioCs()

Usage void spiFlash_exit4ByteAddr_withGpioCs(u32 spi, u32 gpio, u32 cs)
Include driver/spiFlash.h
Parameters [IN] spi SPI base address
[IN] gpio GPIO base address
[IN] cs chip select/slaveID
Description Exit 4-byte addressing with GPIO chip select. Ensure the addressing mode is set to 3-byte before accessing the SPI Flash. Calling spiFlash_manufacturer_id_ function before exiting 4-byte addressing.