1 /*!
2  * @file        apm32f4xx_syscfg.h
3  *
4  * @brief       This file contains all the functions prototypes for the SYSCFG firmware library
5  *
6  * @version     V1.0.2
7  *
8  * @date        2022-06-23
9  *
10  * @attention
11  *
12  *  Copyright (C) 2021-2022 Geehy Semiconductor
13  *
14  *  You may not use this file except in compliance with the
15  *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
16  *
17  *  The program is only for reference, which is distributed in the hope
18  *  that it will be usefull and instructional for customers to develop
19  *  their software. Unless required by applicable law or agreed to in
20  *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
21  *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
22  *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
23  *  and limitations under the License.
24  */
25 
26 /* Define to prevent recursive inclusion */
27 #ifndef __APM32F4XX_SYSCFG_H
28 #define __APM32F4XX_SYSCFG_H
29 
30 #ifdef __cplusplus
31   extern "C" {
32 #endif
33 
34 /* Includes */
35 #include "apm32f4xx.h"
36 
37 /** @addtogroup APM32F4xx_StdPeriphDriver
38   @{
39 */
40 
41 /** @addtogroup SYSCFG_Driver
42   @{
43 */
44 
45 /** @defgroup SYSCFG_Enumerations
46   @{
47 */
48 
49 /**
50  * @brief SYSCFG EINT Port Sources
51  */
52 typedef enum
53 {
54     SYSCFG_PORT_GPIOA, /*!< EXTI_Port Source GPIOA */
55     SYSCFG_PORT_GPIOB, /*!< EXTI_Port Source GPIOB */
56     SYSCFG_PORT_GPIOC, /*!< EXTI_Port Source GPIOC */
57     SYSCFG_PORT_GPIOD, /*!< EXTI_Port Source GPIOD */
58     SYSCFG_PORT_GPIOE, /*!< EXTI_Port Source GPIOE */
59     SYSCFG_PORT_GPIOF, /*!< EXTI_Port Source GPIOF */
60     SYSCFG_PORT_GPIOG, /*!< EXTI_Port Source GPIOG */
61     SYSCFG_PORT_GPIOH, /*!< EXTI_Port Source GPIOH */
62     SYSCFG_PORT_GPIOI  /*!< EXTI_Port Source GPIOI */
63 } SYSCFG_PORT_T;
64 
65 /**
66  * @brief SYSCFG EINT Pin Sources
67  */
68 typedef enum
69 {
70     SYSCFG_PIN_0,  /*!< Pin Source 0 */
71     SYSCFG_PIN_1,  /*!< Pin Source 1 */
72     SYSCFG_PIN_2,  /*!< Pin Source 2 */
73     SYSCFG_PIN_3,  /*!< Pin Source 3 */
74     SYSCFG_PIN_4,  /*!< Pin Source 4 */
75     SYSCFG_PIN_5,  /*!< Pin Source 5 */
76     SYSCFG_PIN_6,  /*!< Pin Source 6 */
77     SYSCFG_PIN_7,  /*!< Pin Source 7 */
78     SYSCFG_PIN_8,  /*!< Pin Source 8 */
79     SYSCFG_PIN_9,  /*!< Pin Source 9 */
80     SYSCFG_PIN_10, /*!< Pin Source 10 */
81     SYSCFG_PIN_11, /*!< Pin Source 11 */
82     SYSCFG_PIN_12, /*!< Pin Source 12 */
83     SYSCFG_PIN_13, /*!< Pin Source 13 */
84     SYSCFG_PIN_14, /*!< Pin Source 14 */
85     SYSCFG_PIN_15  /*!< Pin Source 15 */
86 } SYSCFG_PIN_T;
87 
88 /**
89  * @brief SYSCFG Memory Remap Config
90  */
91 typedef enum
92 {
93     SYSCFG_REMAP_FLASH,         /*!< Memory mapping to Flash */
94     SYSCFG_REMAP_SYSTEM_FLASH,  /*!< Memory mapping to SystemFlash */
95     SYSCFG_REMAP_SMC_BANK1,     /*!< Memory mapping to bank1 of SMC (NOR-flash/PSRAM) */
96     SYSCFG_REMAP_SRAM           /*!< Memory mapping to SRAM */
97 } SYSCFG_REMAP_T;
98 
99 /**
100  * @brief SYSCFG Ethernet PHY interface selection
101  */
102 typedef enum
103 {
104     SYSCFG_INTERFACE_MII,  /*!< SYSCFG Media Interface MII */
105     SYSCFG_INTERFACE_RMII  /*!< SYSCFG Media Interface RMII */
106 } SYSCFG_INTERFACE_T;
107 
108 /**@} end of group SYSCFG_Enumerations*/
109 
110 /** @defgroup SYSCFG_Functions
111   @{
112 */
113 
114 void SYSCFG_Reset(void);
115 void SYSCFG_ConfigMemoryRemap(SYSCFG_REMAP_T memory);
116 void SYSCFG_ConfigEINTLine(SYSCFG_PORT_T port, SYSCFG_PIN_T pin);
117 void SYSCFG_ConfigMediaInterface(SYSCFG_INTERFACE_T media);
118 
119 /* Compensation Cell */
120 void SYSCFG_EnableCompensationCell(void);
121 void SYSCFG_DisableCompensationCell(void);
122 uint8_t SYSCFG_ReadCompensationCellStatus(void);
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif /*__APM32F4XX_SYSCFG_H */
129 
130 /**@} end of group SYSCFG_Enumerations */
131 /**@} end of group SYSCFG_Driver */
132 /**@} end of group APM32F4xx_StdPeriphDriver */
133