Implementation of the QSPI-Flash driver for the DISCO-STM32F746NG board. Allows usage of the MICRON 128Mb Quad-SPI Flash memory present on the board. Ported from library QSPI_DISCO_L476VG from ST.
Fork of QSPI_DISCO_F746NG by
Diff: QSPI_DISCO_F746NG.h
- Revision:
- 1:cff2435c21cf
- Parent:
- 0:f391cd8f34c1
--- a/QSPI_DISCO_F746NG.h Sun Nov 15 14:29:29 2015 +0000 +++ b/QSPI_DISCO_F746NG.h Tue Aug 01 17:33:38 2017 +0000 @@ -29,7 +29,34 @@ present on DISCO_F746NG board. Usage: - + +#include "mbed.h" +#include "QSPI_DISCO_F746NG.h" + +QSPI_DISCO_F746NG qspi; + +#define BUFFER_SIZE ((uint32_t)32) +#define WRITE_READ_ADDR ((uint32_t)0x0050) + +int main() +{ + uint8_t WriteBuffer[BUFFER_SIZE] = "Hello World"; + uint8_t ReadBuffer[BUFFER_SIZE]; + + qspi.Init(); + + // Erase memory + qspi.Erase_Block(WRITE_READ_ADDR); + + // Write memory + qspi.Write(WriteBuffer, WRITE_READ_ADDR, 11); + + // Read memory + qspi.Read(ReadBuffer, WRITE_READ_ADDR, 11); + ReadBuffer[11] = '\0'; + printf("Buffer read [%s]\n", ReadBuffer); +} + */ class QSPI_DISCO_F746NG { @@ -40,7 +67,7 @@ //! Destructor ~QSPI_DISCO_F746NG(); - + /** * @brief Initializes the QSPI interface. * @retval QSPI memory status @@ -79,18 +106,6 @@ uint8_t Erase_Block(uint32_t BlockAddress); /** - * @brief Erases the specified sector of the QSPI memory. - * @param Sector: Sector address to erase (0 to 255); - * @retval QSPI memory status - * @note This function is non blocking meaning that sector erase - * operation is started but not completed when the function - * returns. Application has to call GetStatus(); - * to know when the device is available again (i.e. erase operation - * completed);. - */ - uint8_t Erase_Sector(uint32_t Sector); - - /** * @brief Erases the entire QSPI memory. * @retval QSPI memory status */ @@ -115,19 +130,7 @@ */ uint8_t EnableMemoryMappedMode(void); - /** - * @brief This function suspends an ongoing erase command. - * @retval QSPI memory status - */ - uint8_t SuspendErase(void); - - /** - * @brief This function resumes a paused erase command. - * @retval QSPI memory status - */ - uint8_t ResumeErase(void); - -private: + private: };