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