TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elmot 1:d0dfbce63a89 1 /**
elmot 1:d0dfbce63a89 2 ******************************************************************************
elmot 1:d0dfbce63a89 3 * @file stm32l476g_discovery_qspi.h
elmot 1:d0dfbce63a89 4 * @author MCD Application Team
elmot 1:d0dfbce63a89 5 * @version V1.0.0
elmot 1:d0dfbce63a89 6 * @date 26-June-2015
elmot 1:d0dfbce63a89 7 * @brief This file contains the common defines and functions prototypes for
elmot 1:d0dfbce63a89 8 * the stm32l476g_discovery_qspi.c driver.
elmot 1:d0dfbce63a89 9 ******************************************************************************
elmot 1:d0dfbce63a89 10 * @attention
elmot 1:d0dfbce63a89 11 *
elmot 1:d0dfbce63a89 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
elmot 1:d0dfbce63a89 13 *
elmot 1:d0dfbce63a89 14 * Redistribution and use in source and binary forms, with or without modification,
elmot 1:d0dfbce63a89 15 * are permitted provided that the following conditions are met:
elmot 1:d0dfbce63a89 16 * 1. Redistributions of source code must retain the above copyright notice,
elmot 1:d0dfbce63a89 17 * this list of conditions and the following disclaimer.
elmot 1:d0dfbce63a89 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
elmot 1:d0dfbce63a89 19 * this list of conditions and the following disclaimer in the documentation
elmot 1:d0dfbce63a89 20 * and/or other materials provided with the distribution.
elmot 1:d0dfbce63a89 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
elmot 1:d0dfbce63a89 22 * may be used to endorse or promote products derived from this software
elmot 1:d0dfbce63a89 23 * without specific prior written permission.
elmot 1:d0dfbce63a89 24 *
elmot 1:d0dfbce63a89 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
elmot 1:d0dfbce63a89 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
elmot 1:d0dfbce63a89 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
elmot 1:d0dfbce63a89 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
elmot 1:d0dfbce63a89 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
elmot 1:d0dfbce63a89 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
elmot 1:d0dfbce63a89 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
elmot 1:d0dfbce63a89 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
elmot 1:d0dfbce63a89 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
elmot 1:d0dfbce63a89 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
elmot 1:d0dfbce63a89 35 *
elmot 1:d0dfbce63a89 36 ******************************************************************************
elmot 1:d0dfbce63a89 37 */
elmot 1:d0dfbce63a89 38
elmot 1:d0dfbce63a89 39 /* Define to prevent recursive inclusion -------------------------------------*/
elmot 1:d0dfbce63a89 40 #ifndef __STM32L476G_DISCOVERY_QSPI_H
elmot 1:d0dfbce63a89 41 #define __STM32L476G_DISCOVERY_QSPI_H
elmot 1:d0dfbce63a89 42
elmot 1:d0dfbce63a89 43 #ifdef __cplusplus
elmot 1:d0dfbce63a89 44 extern "C" {
elmot 1:d0dfbce63a89 45 #endif
elmot 1:d0dfbce63a89 46
elmot 1:d0dfbce63a89 47 /* Includes ------------------------------------------------------------------*/
elmot 1:d0dfbce63a89 48 #include "stm32l4xx_hal.h"
elmot 1:d0dfbce63a89 49 #include "n25q128a.h"
elmot 1:d0dfbce63a89 50
elmot 1:d0dfbce63a89 51 /** @addtogroup BSP
elmot 1:d0dfbce63a89 52 * @{
elmot 1:d0dfbce63a89 53 */
elmot 1:d0dfbce63a89 54
elmot 1:d0dfbce63a89 55 /** @addtogroup STM32L476G_DISCOVERY
elmot 1:d0dfbce63a89 56 * @{
elmot 1:d0dfbce63a89 57 */
elmot 1:d0dfbce63a89 58
elmot 1:d0dfbce63a89 59 /** @addtogroup STM32L476G_DISCOVERY_QSPI
elmot 1:d0dfbce63a89 60 * @{
elmot 1:d0dfbce63a89 61 */
elmot 1:d0dfbce63a89 62
elmot 1:d0dfbce63a89 63 /* Exported constants --------------------------------------------------------*/
elmot 1:d0dfbce63a89 64 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Constants Exported Constants
elmot 1:d0dfbce63a89 65 * @{
elmot 1:d0dfbce63a89 66 */
elmot 1:d0dfbce63a89 67 /* QSPI Error codes */
elmot 1:d0dfbce63a89 68 #define QSPI_OK ((uint8_t)0x00)
elmot 1:d0dfbce63a89 69 #define QSPI_ERROR ((uint8_t)0x01)
elmot 1:d0dfbce63a89 70 #define QSPI_BUSY ((uint8_t)0x02)
elmot 1:d0dfbce63a89 71 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
elmot 1:d0dfbce63a89 72 #define QSPI_SUSPENDED ((uint8_t)0x08)
elmot 1:d0dfbce63a89 73
elmot 1:d0dfbce63a89 74 /**
elmot 1:d0dfbce63a89 75 * @}
elmot 1:d0dfbce63a89 76 */
elmot 1:d0dfbce63a89 77
elmot 1:d0dfbce63a89 78 /* Exported types ------------------------------------------------------------*/
elmot 1:d0dfbce63a89 79 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Types Exported Types
elmot 1:d0dfbce63a89 80 * @{
elmot 1:d0dfbce63a89 81 */
elmot 1:d0dfbce63a89 82 /* QSPI Info */
elmot 1:d0dfbce63a89 83 typedef struct {
elmot 1:d0dfbce63a89 84 uint32_t FlashSize; /*!< Size of the flash */
elmot 1:d0dfbce63a89 85 uint32_t EraseSectorSize; /*!< Size of sectors for the erase operation */
elmot 1:d0dfbce63a89 86 uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
elmot 1:d0dfbce63a89 87 uint32_t ProgPageSize; /*!< Size of pages for the program operation */
elmot 1:d0dfbce63a89 88 uint32_t ProgPagesNumber; /*!< Number of pages for the program operation */
elmot 1:d0dfbce63a89 89 } QSPI_Info;
elmot 1:d0dfbce63a89 90
elmot 1:d0dfbce63a89 91 /**
elmot 1:d0dfbce63a89 92 * @}
elmot 1:d0dfbce63a89 93 */
elmot 1:d0dfbce63a89 94
elmot 1:d0dfbce63a89 95 /* Exported functions --------------------------------------------------------*/
elmot 1:d0dfbce63a89 96 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Functions Exported Functions
elmot 1:d0dfbce63a89 97 * @{
elmot 1:d0dfbce63a89 98 */
elmot 1:d0dfbce63a89 99 uint8_t BSP_QSPI_Init (void);
elmot 1:d0dfbce63a89 100 uint8_t BSP_QSPI_DeInit (void);
elmot 1:d0dfbce63a89 101 uint8_t BSP_QSPI_Read (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
elmot 1:d0dfbce63a89 102 uint8_t BSP_QSPI_Write (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
elmot 1:d0dfbce63a89 103 uint8_t BSP_QSPI_Erase_Block (uint32_t BlockAddress);
elmot 1:d0dfbce63a89 104 uint8_t BSP_QSPI_Erase_Sector(uint32_t Sector);
elmot 1:d0dfbce63a89 105 uint8_t BSP_QSPI_Erase_Chip (void);
elmot 1:d0dfbce63a89 106 uint8_t BSP_QSPI_GetStatus (void);
elmot 1:d0dfbce63a89 107 uint8_t BSP_QSPI_GetInfo (QSPI_Info* pInfo);
elmot 1:d0dfbce63a89 108 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
elmot 1:d0dfbce63a89 109 uint8_t BSP_QSPI_SuspendErase(void);
elmot 1:d0dfbce63a89 110 uint8_t BSP_QSPI_ResumeErase (void);
elmot 1:d0dfbce63a89 111
elmot 1:d0dfbce63a89 112 /**
elmot 1:d0dfbce63a89 113 * @}
elmot 1:d0dfbce63a89 114 */
elmot 1:d0dfbce63a89 115
elmot 1:d0dfbce63a89 116 /**
elmot 1:d0dfbce63a89 117 * @}
elmot 1:d0dfbce63a89 118 */
elmot 1:d0dfbce63a89 119
elmot 1:d0dfbce63a89 120 /**
elmot 1:d0dfbce63a89 121 * @}
elmot 1:d0dfbce63a89 122 */
elmot 1:d0dfbce63a89 123
elmot 1:d0dfbce63a89 124 /**
elmot 1:d0dfbce63a89 125 * @}
elmot 1:d0dfbce63a89 126 */
elmot 1:d0dfbce63a89 127
elmot 1:d0dfbce63a89 128 #ifdef __cplusplus
elmot 1:d0dfbce63a89 129 }
elmot 1:d0dfbce63a89 130 #endif
elmot 1:d0dfbce63a89 131
elmot 1:d0dfbce63a89 132 #endif /* __STM32L476G_DISCOVERY_QSPI_H */
elmot 1:d0dfbce63a89 133
elmot 1:d0dfbce63a89 134 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/