gr55xx_hal_aon_gpio_ex.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_hal_aon_gpio_ex.h
5 * @author BLE Driver Team
6 * @brief Header file containing extended macro of AON GPIO HAL library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup HAL_DRIVER HAL Driver
43 * @{
44 */
45
46 /** @defgroup HAL_AON_GPIOEx AON_GPIOEx
47 * @brief AON_GPIOEx HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_AON_GPIO_EX_H__
53 #define __GR55xx_HAL_AON_GPIO_EX_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_hal_def.h"
61 #include "gr55xx_ll_gpio.h"
62
63 /* Exported types ------------------------------------------------------------*/
64
65 /**
66 * @defgroup HAL_AON_GPIOEX_MACRO Defines
67 * @{
68 */
69
70 /* Exported constants --------------------------------------------------------*/
71 /** @defgroup AON_GPIOEx_Exported_Constants AON_GPIOEx Exported Constants
72 * @{
73 */
74
75 /** @defgroup AON_GPIOEx_Mux_Mode AON_GPIOEx Mux Mode definition
76 * @{
77 */
78 #define AON_GPIO_MUX_0 LL_AON_GPIO_MUX_0 /**< AON GPIO Mux mode 0 */
79 #define AON_GPIO_MUX_1 LL_AON_GPIO_MUX_1 /**< AON GPIO Mux mode 1 */
80 #define AON_GPIO_MUX_2 LL_AON_GPIO_MUX_2 /**< AON GPIO Mux mode 2 */
81 #define AON_GPIO_MUX_3 LL_AON_GPIO_MUX_3 /**< AON GPIO Mux mode 3 */
82 #define AON_GPIO_MUX_4 LL_AON_GPIO_MUX_4 /**< AON GPIO Mux mode 4 */
83 #define AON_GPIO_MUX_5 LL_AON_GPIO_MUX_5 /**< AON GPIO Mux mode 5 */
84 #define AON_GPIO_MUX_6 LL_AON_GPIO_MUX_6 /**< AON GPIO Mux mode 6 */
85 #define AON_GPIO_MUX_7 LL_AON_GPIO_MUX_7 /**< AON GPIO Mux mode 7 */
86 /** @} */
87
88 /** @defgroup AON_GPIOEx_Mux_Function_Selection AON_GPIOEx Mux function selection
89 * @{
90 */
91
92
93
94 #if defined (GR552xx)
95 /*---------------------------------- GR552xx ------------------------------*/
96
97 /** @defgroup AON_GPIOEx_Common_Selection AON_GPIO PIN common MUX selection(Available for all AON GPIO pins)
98 * @{
99 */
100
101 #define AON_GPIO_PIN_MUX_GPIO AON_GPIO_MUX_7 /**< AON GPIO PIN x Mux Select GPIO */
102
103 /** @} */
104
105 /** @defgroup AON_GPIOEx_PIN0_Mux_Selection AON_GPIO_PIN0 MUX selection
106 * @{
107 */
108 #define AON_GPIO_PIN0_MUX_UART4_CTS AON_GPIO_MUX_0 /**< AON_GPIO_PIN0 Mux Select UART4_CTS */
109 #define AON_GPIO_PIN0_MUX_I2C4_SCL AON_GPIO_MUX_1 /**< AON_GPIO_PIN0 Mux Select I2C4_SCL */
110 #define AON_GPIO_PIN0_MUX_PWM0_A AON_GPIO_MUX_2 /**< AON_GPIO_PIN0 Mux Select PWM0_A */
111 #define AON_GPIO_PIN0_MUX_SIM_PRESENCE AON_GPIO_MUX_3 /**< AON_GPIO_PIN0 Mux Select SIM_PRESENCE */
112 #define AON_GPIO_PIN0_MUX_PWM0_C AON_GPIO_MUX_4 /**< AON_GPIO_PIN0 Mux Select PWM0_C */
113 #define AON_GPIO_PIN0_MUX_UART2_TX AON_GPIO_MUX_5 /**< AON_GPIO_PIN0 Mux Select UART2_TX */
114 /** @} */
115
116 /** @defgroup AON_GPIOEx_PIN1_Mux_Selection AON_GPIO_PIN1 MUX selection
117 * @{
118 */
119 #define AON_GPIO_PIN1_MUX_UART4_RTS AON_GPIO_MUX_0 /**< AON_GPIO_PIN1 Mux Select UART4_RTS */
120 #define AON_GPIO_PIN1_MUX_I2C4_SDA AON_GPIO_MUX_1 /**< AON_GPIO_PIN1 Mux Select I2C4_SDA */
121 #define AON_GPIO_PIN1_MUX_PWM0_B AON_GPIO_MUX_2 /**< AON_GPIO_PIN1 Mux Select PWM0_B */
122 #define AON_GPIO_PIN1_MUX_SIM_RST_N AON_GPIO_MUX_3 /**< AON_GPIO_PIN1 Mux Select SIM_RST_N */
123 #define AON_GPIO_PIN1_MUX_PWM1_A AON_GPIO_MUX_4 /**< AON_GPIO_PIN1 Mux Select PWM1_A */
124 #define AON_GPIO_PIN1_MUX_UART2_RX AON_GPIO_MUX_5 /**< AON_GPIO_PIN1 Mux Select UART2_RX */
125 /** @} */
126
127 /** @defgroup AON_GPIOEx_PIN2_Mux_Selection AON_GPIO_PIN2 MUX selection
128 * @{
129 */
130 #define AON_GPIO_PIN2_MUX_UART4_TX AON_GPIO_MUX_0 /**< AON_GPIO_PIN2 Mux Select UART4_TX */
131 #define AON_GPIO_PIN2_MUX_I2C1_SCL AON_GPIO_MUX_1 /**< AON_GPIO_PIN2 Mux Select I2C1_SCL */
132 #define AON_GPIO_PIN2_MUX_PWM0_C AON_GPIO_MUX_2 /**< AON_GPIO_PIN2 Mux Select PWM0_C */
133 #define AON_GPIO_PIN2_MUX_SIM_IO AON_GPIO_MUX_3 /**< AON_GPIO_PIN2 Mux Select SIM_IO */
134 #define AON_GPIO_PIN2_MUX_PWM1_B AON_GPIO_MUX_4 /**< AON_GPIO_PIN2 Mux Select PWM1_B */
135 #define AON_GPIO_PIN2_MUX_ISO_SYNC_P AON_GPIO_MUX_5 /**< AON_GPIO_PIN2 Mux Select ISO_SYNC_P */
136 /** @} */
137
138 /** @defgroup AON_GPIOEx_PIN3_Mux_Selection AON_GPIO_PIN3 MUX selection
139 * @{
140 */
141 #define AON_GPIO_PIN3_MUX_UART4_RX AON_GPIO_MUX_0 /**< AON_GPIO_PIN3 Mux Select UART4_RX */
142 #define AON_GPIO_PIN3_MUX_I2C1_SDA AON_GPIO_MUX_1 /**< AON_GPIO_PIN3 Mux Select I2C1_SDA */
143 #define AON_GPIO_PIN3_MUX_PWM1_A AON_GPIO_MUX_2 /**< AON_GPIO_PIN3 Mux Select PWM1_A */
144 #define AON_GPIO_PIN3_MUX_SIM_CLK AON_GPIO_MUX_3 /**< AON_GPIO_PIN3 Mux Select SIM_CLK */
145 #define AON_GPIO_PIN3_MUX_PWM1_C AON_GPIO_MUX_4 /**< AON_GPIO_PIN3 Mux Select PWM1_C */
146 /** @} */
147
148 /** @defgroup AON_GPIOEx_PIN4_Mux_Selection AON_GPIO_PIN4 MUX selection
149 * @{
150 */
151 #define AON_GPIO_PIN4_MUX_PWM0_A AON_GPIO_MUX_0 /**< AON_GPIO_PIN4 Mux Select PWM0_A */
152 #define AON_GPIO_PIN4_MUX_UART5_RX AON_GPIO_MUX_1 /**< AON_GPIO_PIN4 Mux Select UART5_RX */
153 #define AON_GPIO_PIN4_MUX_I2C0_SCL AON_GPIO_MUX_2 /**< AON_GPIO_PIN4 Mux Select I2C0_SCL */
154 #define AON_GPIO_PIN4_MUX_PWM1_B AON_GPIO_MUX_3 /**< AON_GPIO_PIN4 Mux Select PWM1_B */
155 #define AON_GPIO_PIN4_MUX_SIM_CLK AON_GPIO_MUX_4 /**< AON_GPIO_PIN4 Mux Select SIM_CLK */
156 #define AON_GPIO_PIN4_MUX_COEX_BLE_TX AON_GPIO_MUX_5 /**< AON_GPIO_PIN4 Mux Select COEX_BLE_TX */
157 /** @} */
158
159 /** @defgroup AON_GPIOEx_PIN5_Mux_Selection AON_GPIO_PIN5 MUX selection
160 * @{
161 */
162 #define AON_GPIO_PIN5_MUX_PWM0_B AON_GPIO_MUX_0 /**< AON_GPIO_PIN5 Mux Select PWM0_B */
163 #define AON_GPIO_PIN5_MUX_UART5_TX AON_GPIO_MUX_1 /**< AON_GPIO_PIN5 Mux Select UART5_TX */
164 #define AON_GPIO_PIN5_MUX_I2C0_SDA AON_GPIO_MUX_2 /**< AON_GPIO_PIN5 Mux Select I2C0_SDA */
165 #define AON_GPIO_PIN5_MUX_PWM1_C AON_GPIO_MUX_3 /**< AON_GPIO_PIN5 Mux Select PWM1_C */
166 #define AON_GPIO_PIN5_MUX_ISO_SYNC_P AON_GPIO_MUX_4 /**< AON_GPIO_PIN5 Mux Select ISO_SYNC_P */
167 #define AON_GPIO_PIN5_MUX_COEX_BLE_RX AON_GPIO_MUX_5 /**< AON_GPIO_PIN5 Mux Select COEX_BLE_RX */
168 /** @} */
169
170 /** @defgroup AON_GPIOEx_PIN6_Mux_Selection AON_GPIO_PIN6 MUX selection
171 * @{
172 */
173 #define AON_GPIO_PIN6_MUX_PWM0_C AON_GPIO_MUX_0 /**< AON_GPIO_PIN6 Mux Select PWM0_C */
174 #define AON_GPIO_PIN6_MUX_UART5_CTS AON_GPIO_MUX_1 /**< AON_GPIO_PIN6 Mux Select UART5_CTS */
175 #define AON_GPIO_PIN6_MUX_I2C5_SCL AON_GPIO_MUX_2 /**< AON_GPIO_PIN6 Mux Select I2C5_SCL */
176 #define AON_GPIO_PIN6_MUX_PDM_CLKO AON_GPIO_MUX_3 /**< AON_GPIO_PIN6 Mux Select PDM_CLKO */
177 #define AON_GPIO_PIN6_MUX_UART1_RX AON_GPIO_MUX_4 /**< AON_GPIO_PIN6 Mux Select UART1_RX */
178 #define AON_GPIO_PIN6_MUX_COEX_WLAN_TX AON_GPIO_MUX_5 /**< AON_GPIO_PIN6 Mux Select COEX_WLAN_TX */
179 /** @} */
180
181 /** @defgroup AON_GPIOEx_PIN7_Mux_Selection AON_GPIO_PIN7 MUX selection
182 * @{
183 */
184 #define AON_GPIO_PIN7_MUX_PWM1_A AON_GPIO_MUX_0 /**< AON_GPIO_PIN7 Mux Select PWM1_A */
185 #define AON_GPIO_PIN7_MUX_UART5_RTS AON_GPIO_MUX_1 /**< AON_GPIO_PIN7 Mux Select UART5_RTS */
186 #define AON_GPIO_PIN7_MUX_I2C5_SDA AON_GPIO_MUX_2 /**< AON_GPIO_PIN7 Mux Select I2C5_SDA */
187 #define AON_GPIO_PIN7_MUX_PDM_DI AON_GPIO_MUX_3 /**< AON_GPIO_PIN7 Mux Select PDM_DI */
188 #define AON_GPIO_PIN7_MUX_UART1_TX AON_GPIO_MUX_4 /**< AON_GPIO_PIN7 Mux Select UART1_TX */
189 #define AON_GPIO_PIN7_MUX_COEX_WLAN_RX AON_GPIO_MUX_5 /**< AON_GPIO_PIN7 Mux Select COEX_WLAN_RX */
190 /** @} */
191
192
193 /**
194 * @brief Check if AON GPIO Mux mode is valid.
195 * @param __MUX__ AON GPIO Mux mode.
196 * @retval SET (__ACTION__ is valid) or RESET (__ACTION__ is invalid)
197 */
198 #define IS_AON_GPIO_MUX(__MUX__) (((__MUX__) <= AON_GPIO_MUX_7))
199
200 /*------------------------------------------------------------------------------------------*/
201 #endif /* GR552xx */
202
203 /** @} */
204
205 /** @} */
206
207 /** @} */
208
209 #ifdef __cplusplus
210 }
211 #endif
212
213 #endif /* __GR55xx_HAL_AON_GPIO_EX_H__ */
214
215 /** @} */
216
217 /** @} */
218
219 /** @} */
220
gr55xx_ll_gpio.h
Header file containing functions prototypes of GPIO LL library.
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.