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 #define AON_GPIO_MUX_8 LL_AON_GPIO_MUX_8 /**< AON GPIO Mux mode 8 */
87 /** @} */
88
89 /** @defgroup AON_GPIOEx_Mux_Function_Selection AON_GPIOEx Mux function selection
90 * @{
91 */
92
93
94
95 #if defined (GR5X25)
96 /*---------------------------------- GR5X25 ------------------------------*/
97
98 /** @defgroup AON_GPIOEx_Common_Selection AON_GPIO PIN common MUX selection(Available for all AON GPIO pins)
99 * @{
100 */
101
102 #define AON_GPIO_PIN_MUX_GPIO AON_GPIO_MUX_8 /**< AON GPIO PIN x Mux Select GPIO */
103
104 /** @} */
105
106 /** @defgroup AON_GPIOEx_PIN0_Mux_Selection AON_GPIO_PIN0 MUX selection
107 * @{
108 */
109 #define AON_GPIO_PIN0_MUX_UART1_CTS AON_GPIO_MUX_0 /**< AON_GPIO_PIN0 Mux Select UART1_CTS */
110 #define AON_GPIO_PIN0_MUX_I2C0_SCL AON_GPIO_MUX_1 /**< AON_GPIO_PIN0 Mux Select I2C0_SCL */
111 #define AON_GPIO_PIN0_MUX_PWM0_A AON_GPIO_MUX_2 /**< AON_GPIO_PIN0 Mux Select PWM0_A */
112 #define AON_GPIO_PIN0_MUX_SIM_PRESENCE AON_GPIO_MUX_3 /**< AON_GPIO_PIN0 Mux Select SIM_PRESENCE */
113 #define AON_GPIO_PIN0_MUX_PWM0_C AON_GPIO_MUX_4 /**< AON_GPIO_PIN0 Mux Select PWM0_C */
114 /** @} */
115
116 /** @defgroup AON_GPIOEx_PIN1_Mux_Selection AON_GPIO_PIN1 MUX selection
117 * @{
118 */
119 #define AON_GPIO_PIN1_MUX_UART1_RTS AON_GPIO_MUX_0 /**< AON_GPIO_PIN1 Mux Select UART1_RTS */
120 #define AON_GPIO_PIN1_MUX_I2C0_SDA AON_GPIO_MUX_1 /**< AON_GPIO_PIN1 Mux Select I2C0_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 /** @} */
125
126 /** @defgroup AON_GPIOEx_PIN2_Mux_Selection AON_GPIO_PIN2 MUX selection
127 * @{
128 */
129 #define AON_GPIO_PIN2_MUX_UART1_TX AON_GPIO_MUX_0 /**< AON_GPIO_PIN2 Mux Select UART1_TX */
130 #define AON_GPIO_PIN2_MUX_I2C1_SCL AON_GPIO_MUX_1 /**< AON_GPIO_PIN2 Mux Select I2C1_SCL */
131 #define AON_GPIO_PIN2_MUX_PWM0_C AON_GPIO_MUX_2 /**< AON_GPIO_PIN2 Mux Select PWM0_C */
132 #define AON_GPIO_PIN2_MUX_SIM_IO AON_GPIO_MUX_3 /**< AON_GPIO_PIN2 Mux Select SIM_IO */
133 #define AON_GPIO_PIN2_MUX_PWM1_B AON_GPIO_MUX_5 /**< AON_GPIO_PIN2 Mux Select PWM1_B */
134 /** @} */
135
136 /** @defgroup AON_GPIOEx_PIN3_Mux_Selection AON_GPIO_PIN3 MUX selection
137 * @{
138 */
139 #define AON_GPIO_PIN3_MUX_UART1_RX AON_GPIO_MUX_0 /**< AON_GPIO_PIN3 Mux Select UART1_RX */
140 #define AON_GPIO_PIN3_MUX_I2C1_SDA AON_GPIO_MUX_1 /**< AON_GPIO_PIN3 Mux Select I2C1_SDA */
141 #define AON_GPIO_PIN3_MUX_PWM1_A AON_GPIO_MUX_2 /**< AON_GPIO_PIN3 Mux Select PWM1_A */
142 #define AON_GPIO_PIN3_MUX_SIM_CLK AON_GPIO_MUX_3 /**< AON_GPIO_PIN3 Mux Select SIM_CLK */
143 #define AON_GPIO_PIN3_MUX_PWM2_C AON_GPIO_MUX_5 /**< AON_GPIO_PIN3 Mux Select PWM2_C */
144 /** @} */
145
146 /** @defgroup AON_GPIOEx_PIN4_Mux_Selection AON_GPIO_PIN4 MUX selection
147 * @{
148 */
149 #define AON_GPIO_PIN4_MUX_PWM0_A AON_GPIO_MUX_0 /**< AON_GPIO_PIN4 Mux Select PWM0_A */
150 #define AON_GPIO_PIN4_MUX_UART0_RX AON_GPIO_MUX_1 /**< AON_GPIO_PIN4 Mux Select UART0_RX */
151 #define AON_GPIO_PIN4_MUX_I2C0_SCL AON_GPIO_MUX_2 /**< AON_GPIO_PIN4 Mux Select I2C0_SCL */
152 #define AON_GPIO_PIN4_MUX_PWM1_B AON_GPIO_MUX_3 /**< AON_GPIO_PIN4 Mux Select PWM1_B */
153 #define AON_GPIO_PIN4_MUX_SIM_CLK AON_GPIO_MUX_5 /**< AON_GPIO_PIN4 Mux Select SIM_CLK */
154 #define AON_GPIO_PIN4_MUX_COEX_BLE_TX AON_GPIO_MUX_6 /**< AON_GPIO_PIN4 Mux Select COEX_BLE_TX */
155 /** @} */
156
157 /** @defgroup AON_GPIOEx_PIN5_Mux_Selection AON_GPIO_PIN5 MUX selection
158 * @{
159 */
160 #define AON_GPIO_PIN5_MUX_PWM0_A AON_GPIO_MUX_0 /**< AON_GPIO_PIN5 Mux Select PWM0_A */
161 #define AON_GPIO_PIN5_MUX_UART0_TX AON_GPIO_MUX_1 /**< AON_GPIO_PIN5 Mux Select UART0_TX */
162 #define AON_GPIO_PIN5_MUX_I2C0_SDA AON_GPIO_MUX_2 /**< AON_GPIO_PIN5 Mux Select I2C0_SDA */
163 #define AON_GPIO_PIN5_MUX_PWM1_C AON_GPIO_MUX_3 /**< AON_GPIO_PIN5 Mux Select PWM1_C */
164 #define AON_GPIO_PIN4_MUX_COEX_BLE_RX AON_GPIO_MUX_5 /**< AON_GPIO_PIN4 Mux Select COEX_BLE_RX */
165 /** @} */
166
167 /** @defgroup AON_GPIOEx_PIN6_Mux_Selection AON_GPIO_PIN6 MUX selection
168 * @{
169 */
170 #define AON_GPIO_PIN6_MUX_PWM0_B AON_GPIO_MUX_0 /**< AON_GPIO_PIN6 Mux Select PWM0_B */
171 #define AON_GPIO_PIN6_MUX_UART0_CTS AON_GPIO_MUX_1 /**< AON_GPIO_PIN6 Mux Select UART0_CTS */
172 #define AON_GPIO_PIN6_MUX_I2C1_SCL AON_GPIO_MUX_2 /**< AON_GPIO_PIN6 Mux Select I2C1_SCL */
173 #define AON_GPIO_PIN6_MUX_PDM_CLKO AON_GPIO_MUX_3 /**< AON_GPIO_PIN6 Mux Select PDM_CLKO */
174 #define AON_GPIO_PIN6_MUX_UART1_RX AON_GPIO_MUX_4 /**< AON_GPIO_PIN6 Mux Select UART1_RX */
175 /** @} */
176
177 /** @defgroup AON_GPIOEx_PIN7_Mux_Selection AON_GPIO_PIN7 MUX selection
178 * @{
179 */
180 #define AON_GPIO_PIN7_MUX_PWM1_A AON_GPIO_MUX_0 /**< AON_GPIO_PIN7 Mux Select PWM1_A */
181 #define AON_GPIO_PIN7_MUX_UART0_RTS AON_GPIO_MUX_1 /**< AON_GPIO_PIN7 Mux Select UART0_RTS */
182 #define AON_GPIO_PIN7_MUX_I2C1_SDA AON_GPIO_MUX_2 /**< AON_GPIO_PIN7 Mux Select I2C1_SDA */
183 #define AON_GPIO_PIN7_MUX_PDM_DI AON_GPIO_MUX_3 /**< AON_GPIO_PIN7 Mux Select PDM_DI */
184 #define AON_GPIO_PIN7_MUX_UART1_TX AON_GPIO_MUX_4 /**< AON_GPIO_PIN7 Mux Select UART1_TX */
185 /** @} */
186
187
188 /**
189 * @brief Check if AON GPIO Mux mode is valid.
190 * @param __MUX__ AON GPIO Mux mode.
191 * @retval SET (__ACTION__ is valid) or RESET (__ACTION__ is invalid)
192 */
193 #define IS_AON_GPIO_MUX(__MUX__) (((__MUX__) <= AON_GPIO_MUX_7))
194
195 /*------------------------------------------------------------------------------------------*/
196 #endif /* GR5X25 */
197
198 /** @} */
199
200 /** @} */
201
202 /** @} */
203
204 #ifdef __cplusplus
205 }
206 #endif
207
208 #endif /* __GR55xx_HAL_AON_GPIO_EX_H__ */
209
210 /** @} */
211
212 /** @} */
213
214 /** @} */
215
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.