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
Revision 1:cff2435c21cf, committed 2017-08-01
- Comitter:
- marcusncunha
- Date:
- Tue Aug 01 17:33:38 2017 +0000
- Parent:
- 0:f391cd8f34c1
- Commit message:
- 1
Changed in this revision
QSPI_DISCO_F746NG.cpp | Show annotated file Show diff for this revision Revisions of this file |
QSPI_DISCO_F746NG.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r f391cd8f34c1 -r cff2435c21cf QSPI_DISCO_F746NG.cpp --- a/QSPI_DISCO_F746NG.cpp Sun Nov 15 14:29:29 2015 +0000 +++ b/QSPI_DISCO_F746NG.cpp Tue Aug 01 17:33:38 2017 +0000 @@ -59,11 +59,6 @@ return BSP_QSPI_Erase_Block(BlockAddress); } -uint8_t QSPI_DISCO_F746NG::Erase_Sector(uint32_t Sector) -{ - return BSP_QSPI_Erase_Sector(Sector); -} - uint8_t QSPI_DISCO_F746NG::Erase_Chip(void) { return BSP_QSPI_Erase_Chip(); @@ -81,19 +76,5 @@ uint8_t QSPI_DISCO_F746NG::EnableMemoryMappedMode(void) { - return BSP_QSPI_EnableMemoryMappedMode(); -} - -uint8_t QSPI_DISCO_F746NG::SuspendErase(void) -{ - return BSP_QSPI_SuspendErase(); + return BSP_QSPI_MemoryMappedMode(); } - -uint8_t QSPI_DISCO_F746NG::ResumeErase(void) -{ - return BSP_QSPI_ResumeErase(); -} - -//================================================================================================================= -// Private methods -//=================================================================================================================
diff -r f391cd8f34c1 -r cff2435c21cf QSPI_DISCO_F746NG.h --- 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: };