-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstm32l476g_eval_qspi.h
113 lines (93 loc) · 2.94 KB
/
stm32l476g_eval_qspi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
******************************************************************************
* @file stm32l476g_eval_qspi.h
* @author MCD Application Team
* @brief This file contains the common defines and functions prototypes for
* the stm32l476g_eval_qspi.c driver.
******************************************************************************
* @attention
*
* Copyright (c) 2016 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32L476G_EVAL_QSPI_H
#define __STM32L476G_EVAL_QSPI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal.h"
#include "../Components/n25q256a/n25q256a.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup STM32L476G_EVAL
* @{
*/
/** @addtogroup STM32L476G_EVAL_QSPI
* @{
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup STM32L476G_EVAL_QSPI_Exported_Constants Exported Constants
* @{
*/
/* QSPI Error codes */
#define QSPI_OK ((uint8_t)0x00)
#define QSPI_ERROR ((uint8_t)0x01)
#define QSPI_BUSY ((uint8_t)0x02)
#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
#define QSPI_SUSPENDED ((uint8_t)0x08)
/**
* @}
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup STM32L476G_EVAL_QSPI_Exported_Types Exported Types
* @{
*/
/* QSPI Info */
typedef struct {
uint32_t FlashSize; /*!< Size of the flash */
uint32_t EraseSectorSize; /*!< Size of sectors for the erase operation */
uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
uint32_t ProgPageSize; /*!< Size of pages for the program operation */
uint32_t ProgPagesNumber; /*!< Number of pages for the program operation */
} QSPI_Info;
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup STM32L476G_EVAL_QSPI_Exported_Functions Exported Functions
* @{
*/
uint8_t BSP_QSPI_Init (void);
uint8_t BSP_QSPI_DeInit (void);
uint8_t BSP_QSPI_Read (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
uint8_t BSP_QSPI_Write (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
uint8_t BSP_QSPI_Erase_Block (uint32_t BlockAddress);
uint8_t BSP_QSPI_Erase_Chip (void);
uint8_t BSP_QSPI_GetStatus (void);
uint8_t BSP_QSPI_GetInfo (QSPI_Info* pInfo);
uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32L476G_EVAL_QSPI_H */