Baremetal application to read and write on qspi flash of DE0-NANO-SOC

Hello,

I am new developer for the Cyclone v SoC.

I want to read and write from the QSPI flash in my HPS baremetal application. I want to write a very simple data in words format.
e.g.
write data 0xABCD, 0xCDEF, 0x1234
and then read it back.

I checked the following functions but they are not working for me.
alt_qspi_write
alt_qspi_read

I think i need to initialize the qspi and do the other initialization etc before using alt_qspi_write or alt_qspi_read.

Is there any one who developed a c program for QSPI of DE0-NANO-SOC?
is there any built application project doing the simple read and write on QSPI?