Class to drive the QSPI external memory (N25Q128A device) present on DISCO_F746NG board.

Dependents:   F746_Fourier_series_of_square_wave_01 F746_AudioOutQSPI DISCO-F746-Dessiccateur-V1 DISCO-F746NG_Monttory_Base ... more

Committer:
bcostm
Date:
Mon Jan 04 15:19:45 2016 +0000
Revision:
0:be9d625054cd
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:be9d625054cd 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
bcostm 0:be9d625054cd 2 *
bcostm 0:be9d625054cd 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
bcostm 0:be9d625054cd 4 * and associated documentation files (the "Software"), to deal in the Software without
bcostm 0:be9d625054cd 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
bcostm 0:be9d625054cd 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
bcostm 0:be9d625054cd 7 * Software is furnished to do so, subject to the following conditions:
bcostm 0:be9d625054cd 8 *
bcostm 0:be9d625054cd 9 * The above copyright notice and this permission notice shall be included in all copies or
bcostm 0:be9d625054cd 10 * substantial portions of the Software.
bcostm 0:be9d625054cd 11 *
bcostm 0:be9d625054cd 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
bcostm 0:be9d625054cd 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
bcostm 0:be9d625054cd 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
bcostm 0:be9d625054cd 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
bcostm 0:be9d625054cd 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bcostm 0:be9d625054cd 17 */
bcostm 0:be9d625054cd 18
bcostm 0:be9d625054cd 19 #include "QSPI_DISCO_F746NG.h"
bcostm 0:be9d625054cd 20
bcostm 0:be9d625054cd 21 // Constructor
bcostm 0:be9d625054cd 22 QSPI_DISCO_F746NG::QSPI_DISCO_F746NG()
bcostm 0:be9d625054cd 23 {
bcostm 0:be9d625054cd 24 BSP_QSPI_Init();
bcostm 0:be9d625054cd 25 }
bcostm 0:be9d625054cd 26
bcostm 0:be9d625054cd 27 // Destructor
bcostm 0:be9d625054cd 28 QSPI_DISCO_F746NG::~QSPI_DISCO_F746NG()
bcostm 0:be9d625054cd 29 {
bcostm 0:be9d625054cd 30 BSP_QSPI_DeInit();
bcostm 0:be9d625054cd 31 }
bcostm 0:be9d625054cd 32
bcostm 0:be9d625054cd 33 //=================================================================================================================
bcostm 0:be9d625054cd 34 // Public methods
bcostm 0:be9d625054cd 35 //=================================================================================================================
bcostm 0:be9d625054cd 36
bcostm 0:be9d625054cd 37 uint8_t QSPI_DISCO_F746NG::Init(void)
bcostm 0:be9d625054cd 38 {
bcostm 0:be9d625054cd 39 return BSP_QSPI_Init();
bcostm 0:be9d625054cd 40 }
bcostm 0:be9d625054cd 41
bcostm 0:be9d625054cd 42 uint8_t QSPI_DISCO_F746NG::DeInit(void)
bcostm 0:be9d625054cd 43 {
bcostm 0:be9d625054cd 44 return BSP_QSPI_DeInit();
bcostm 0:be9d625054cd 45 }
bcostm 0:be9d625054cd 46
bcostm 0:be9d625054cd 47 uint8_t QSPI_DISCO_F746NG::Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
bcostm 0:be9d625054cd 48 {
bcostm 0:be9d625054cd 49 return BSP_QSPI_Read(pData, ReadAddr, Size);
bcostm 0:be9d625054cd 50 }
bcostm 0:be9d625054cd 51
bcostm 0:be9d625054cd 52 uint8_t QSPI_DISCO_F746NG::Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
bcostm 0:be9d625054cd 53 {
bcostm 0:be9d625054cd 54 return BSP_QSPI_Write(pData, WriteAddr, Size);
bcostm 0:be9d625054cd 55 }
bcostm 0:be9d625054cd 56
bcostm 0:be9d625054cd 57 uint8_t QSPI_DISCO_F746NG::Erase_Block(uint32_t BlockAddress)
bcostm 0:be9d625054cd 58 {
bcostm 0:be9d625054cd 59 return BSP_QSPI_Erase_Block(BlockAddress);
bcostm 0:be9d625054cd 60 }
bcostm 0:be9d625054cd 61
bcostm 0:be9d625054cd 62 uint8_t QSPI_DISCO_F746NG::Erase_Chip(void)
bcostm 0:be9d625054cd 63 {
bcostm 0:be9d625054cd 64 return BSP_QSPI_Erase_Chip();
bcostm 0:be9d625054cd 65 }
bcostm 0:be9d625054cd 66
bcostm 0:be9d625054cd 67 uint8_t QSPI_DISCO_F746NG::GetStatus(void)
bcostm 0:be9d625054cd 68 {
bcostm 0:be9d625054cd 69 return BSP_QSPI_GetStatus();
bcostm 0:be9d625054cd 70 }
bcostm 0:be9d625054cd 71
bcostm 0:be9d625054cd 72 uint8_t QSPI_DISCO_F746NG::GetInfo(QSPI_Info* pInfo)
bcostm 0:be9d625054cd 73 {
bcostm 0:be9d625054cd 74 return BSP_QSPI_GetInfo(pInfo);
bcostm 0:be9d625054cd 75 }
bcostm 0:be9d625054cd 76
bcostm 0:be9d625054cd 77 uint8_t QSPI_DISCO_F746NG::EnableMemoryMappedMode(void)
bcostm 0:be9d625054cd 78 {
bcostm 0:be9d625054cd 79 return BSP_QSPI_MemoryMappedMode();
bcostm 0:be9d625054cd 80 }