1 /*******************************************************************************
2 * @file rsi_rom_egpio.h
3 *******************************************************************************
4 * # License
5 * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
6 *******************************************************************************
7 *
8 * SPDX-License-Identifier: Zlib
9 *
10 * The licensor of this software is Silicon Laboratories Inc.
11 *
12 * This software is provided 'as-is', without any express or implied
13 * warranty. In no event will the authors be held liable for any damages
14 * arising from the use of this software.
15 *
16 * Permission is granted to anyone to use this software for any purpose,
17 * including commercial applications, and to alter it and redistribute it
18 * freely, subject to the following restrictions:
19 *
20 * 1. The origin of this software must not be misrepresented; you must not
21 * claim that you wrote the original software. If you use this software
22 * in a product, an acknowledgment in the product documentation would be
23 * appreciated but is not required.
24 * 2. Altered source versions must be plainly marked as such, and must not be
25 * misrepresented as being the original software.
26 * 3. This notice may not be removed or altered from any source distribution.
27 *
28 ******************************************************************************/
29
30 //Includes
31
32 #ifndef __RSI_ROM_EGPIO_H__
33 #define __RSI_ROM_EGPIO_H__
34
35 /**
36 * \ingroup RSI_SPECIFIC_DRIVERS
37 * \defgroup EGPIO_DRIVER
38 * @{
39 *
40 */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 #include "rsi_ccp_user_config.h"
46 #include "rsi_packing.h"
47 #include "rsi_egpio.h"
48 #if defined(A11_ROM)
49 #include "rsi_rom_table_si91x.h"
50 #else
51 #include "rsi_rom_table_RS1xxxx.h"
52 #endif
53 /** @addtogroup SOC11
54 * @{
55 */
56
57 /**
58 * @fn STATIC INLINE void RSI_EGPIO_SetDir(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin, boolean_t dir)
59 * @brief This API is used to set the EGPIO direction(Direction of the GPIO pin. '1' for INPUT, '0' for OUTPUT)
60 * @param[in] pEGPIO : Pointer to the EGPIO register instance
61 * @param[in] port : GPIO port number
62 * @param[in] pin : GPIO pin number
63 * @param[in] dir : boolean type pin direction
64 * \n '0' : Output
65 * \n '1' : Input
66 * @return None
67 */
RSI_EGPIO_SetDir(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin,boolean_t dir)68 STATIC INLINE void RSI_EGPIO_SetDir(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin, boolean_t dir)
69 {
70 #if defined(ROMDRIVER_PRESENT)
71 ROMAPI_EGPIO_API->egpio_set_dir(pEGPIO, port, pin, dir);
72 #else
73 egpio_set_dir(pEGPIO, port, pin, dir);
74 #endif
75 }
76
77 /**
78 * @fn STATIC INLINE void RSI_EGPIO_SetPin(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin , uint8_t val)
79 * @brief This API is used to set the GPIO pin value.It Loads 0th bit on to the pin on write &
80 * reads the value on pin on read into 0th bit
81 * @param[in] pEGPIO : Pointer to the EGPIO register instance
82 * @param[in] port : GPIO port number
83 * @param[in] pin : GPIO pin number
84 * @param[in] val : value to be set for the pin
85 * \n '0' : Logic on Pin
86 * \n '1' : Logic on Pin
87 * @return None
88 */
RSI_EGPIO_SetPin(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin,uint8_t val)89 STATIC INLINE void RSI_EGPIO_SetPin(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin, uint8_t val)
90 {
91 #if defined(ROMDRIVER_PRESENT)
92 ROMAPI_EGPIO_API->egpio_set_pin(pEGPIO, port, pin, val);
93 #else
94 egpio_set_pin(pEGPIO, port, pin, val);
95 #endif
96 }
97
98 /**
99 * @fn STATIC INLINE boolean_t RSI_EGPIO_GetPin(const EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin)
100 * @brief This API is used get the GPIO pin status.
101 * @param[in] pEGPIO : Pointer to the EGPIO register instance
102 * @param[in] port : GPIO port number
103 * @param[in] pin : GPIO pin number
104 * @return returns Pin status
105 */
RSI_EGPIO_GetPin(const EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)106 STATIC INLINE boolean_t RSI_EGPIO_GetPin(const EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
107 {
108 #if defined(ROMDRIVER_PRESENT)
109 return ROMAPI_EGPIO_API->egpio_get_pin(pEGPIO, port, pin);
110 #else
111 return egpio_get_pin(pEGPIO, port, pin);
112 #endif
113 }
114
115 /**
116 * @fn STATIC INLINE boolean_t RSI_EGPIO_GetDir(const EGPIO_Type *pEGPIO,uint8_t port ,uint8_t pin)
117 * @brief This API is used to Get the Direction GPIO(Direction of the GPIO pin. '1' for INPUT,and '0'for OUTPUT)
118 * @param[in] pEGPIO : Pointer to the EGPIO register instance
119 * @param[in] port : GPIO port number
120 * @param[in] pin : GPIO pin number
121 * @return returns the GPIO direction value
122 */
RSI_EGPIO_GetDir(const EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)123 STATIC INLINE boolean_t RSI_EGPIO_GetDir(const EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
124 {
125 #if defined(ROMDRIVER_PRESENT)
126 return ROMAPI_EGPIO_API->egpio_get_dir(pEGPIO, port, pin);
127 #else
128 return egpio_get_dir(pEGPIO, port, pin);
129 #endif
130 }
131
132 /**
133 * @fn STATIC INLINE void RSI_EGPIO_PinIntSel(EGPIO_Type *pEGPIO ,uint8_t intCh ,uint8_t port , uint8_t pin)
134 * @brief This API is used to select the pin for interrupt generation
135 * @param[in] pEGPIO : Pointer to the EGPIO register instance
136 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
137 * @param[in] port : GPIO port number
138 * @param[in] pin : GPIO pin number
139 * @return None
140 */
RSI_EGPIO_PinIntSel(EGPIO_Type * pEGPIO,uint8_t intCh,uint8_t port,uint8_t pin)141 STATIC INLINE void RSI_EGPIO_PinIntSel(EGPIO_Type *pEGPIO, uint8_t intCh, uint8_t port, uint8_t pin)
142 {
143 #if defined(ROMDRIVER_PRESENT)
144 ROMAPI_EGPIO_API->egpio_pin_int_sel(pEGPIO, intCh, port, pin);
145 #else
146 egpio_pin_int_sel(pEGPIO, intCh, port, pin);
147 #endif
148 }
149
150 /**
151 * @fn STATIC INLINE void RSI_EGPIO_SetIntFallEdgeEnable(EGPIO_Type *pEGPIO ,uint8_t intCh)
152 * @brief This API is used to set the pin interrupt mode configuration
153 * \n(enables interrupt generation when falling edge is detected on pin '1' for intr enabled and '0' for disabled)
154 * @param[in] pEGPIO : Pointer to the EGPIO register instance
155 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
156 * @return None
157 */
RSI_EGPIO_SetIntFallEdgeEnable(EGPIO_Type * pEGPIO,uint8_t intCh)158 STATIC INLINE void RSI_EGPIO_SetIntFallEdgeEnable(EGPIO_Type *pEGPIO, uint8_t intCh)
159 {
160 #if defined(ROMDRIVER_PRESENT)
161 ROMAPI_EGPIO_API->egpio_set_int_fall_edge_enable(pEGPIO, intCh);
162 #else
163 egpio_set_int_fall_edge_enable(pEGPIO, intCh);
164 #endif
165 }
166
167 /**
168 * @fn STATIC INLINE void RSI_EGPIO_SetIntFallEdgeDisable(EGPIO_Type *pEGPIO ,uint8_t intCh)
169 * @brief This API to used to set the pin interrupt mode configuration
170 * \n(enables interrupt generation when falling edge is detected on pin '1' for intr enabled and '0' for disabled)
171 * @param[in] pEGPIO : Pointer to the EGPIO register instance
172 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
173 * @return None
174 */
RSI_EGPIO_SetIntFallEdgeDisable(EGPIO_Type * pEGPIO,uint8_t intCh)175 STATIC INLINE void RSI_EGPIO_SetIntFallEdgeDisable(EGPIO_Type *pEGPIO, uint8_t intCh)
176 {
177 #if defined(ROMDRIVER_PRESENT)
178 ROMAPI_EGPIO_API->egpio_set_int_fall_edge_disable(pEGPIO, intCh);
179 #else
180 egpio_set_int_fall_edge_disable(pEGPIO, intCh);
181 #endif
182 }
183
184 /**
185 * @fn STATIC INLINE void RSI_EGPIO_SetIntRiseEdgeEnable(EGPIO_Type *pEGPIO ,uint8_t intCh)
186 * @brief This API to used to set the pin interrupt mode configuration
187 * \n(enables interrupt generation when rising edge is detected on pin '1' for intr enabled and '0' for disabled)
188 * @param[in] pEGPIO : Pointer to the EGPIO register instance
189 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
190 * @return None
191 */
RSI_EGPIO_SetIntRiseEdgeEnable(EGPIO_Type * pEGPIO,uint8_t intCh)192 STATIC INLINE void RSI_EGPIO_SetIntRiseEdgeEnable(EGPIO_Type *pEGPIO, uint8_t intCh)
193 {
194 #if defined(ROMDRIVER_PRESENT)
195 ROMAPI_EGPIO_API->egpio_set_int_rise_edge_enable(pEGPIO, intCh);
196 #else
197 egpio_set_int_rise_edge_enable(pEGPIO, intCh);
198 #endif
199 }
200
201 /**
202 * @fn STATIC INLINE void RSI_EGPIO_SetIntRiseEdgeDisable(EGPIO_Type *pEGPIO ,uint8_t intCh)
203 * @brief This API to used to set the pin interrupt mode configuration
204 * \n(enables interrupt generation when rising edge is detected on pin '1' for intr enabled '0' for disabled)
205 * @param[in] pEGPIO : Pointer to the EGPIO register instance
206 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
207 * @return None
208 */
RSI_EGPIO_SetIntRiseEdgeDisable(EGPIO_Type * pEGPIO,uint8_t intCh)209 STATIC INLINE void RSI_EGPIO_SetIntRiseEdgeDisable(EGPIO_Type *pEGPIO, uint8_t intCh)
210 {
211 #if defined(ROMDRIVER_PRESENT)
212 ROMAPI_EGPIO_API->egpio_set_int_rise_edge_disable(pEGPIO, intCh);
213 #else
214 egpio_set_int_rise_edge_disable(pEGPIO, intCh);
215 #endif
216 }
217
218 /**
219 * @fn STATIC INLINE void RSI_EGPIO_SetIntLowLevelEnable(EGPIO_Type *pEGPIO ,uint8_t intCh)
220 * @brief This API is used to set the pin interrupt mode configuration
221 * \n (enables interrupt generation when pin level is 0, '1' for intr enabled, '0' for disabled)
222 * @param[in] pEGPIO : Pointer to the EGPIO register instance
223 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
224 * @return None
225 */
RSI_EGPIO_SetIntLowLevelEnable(EGPIO_Type * pEGPIO,uint8_t intCh)226 STATIC INLINE void RSI_EGPIO_SetIntLowLevelEnable(EGPIO_Type *pEGPIO, uint8_t intCh)
227 {
228 #if defined(ROMDRIVER_PRESENT)
229 ROMAPI_EGPIO_API->egpio_set_int_low_level_enable(pEGPIO, intCh);
230 #else
231 egpio_set_int_low_level_enable(pEGPIO, intCh);
232 #endif
233 }
234
235 /**
236 * @fn STATIC INLINE void RSI_EGPIO_IntMask(EGPIO_Type *pEGPIO ,uint8_t intCh)
237 * @brief This API is used to set the pin interrupt mode configuration
238 * \n(Masks the interrupt. Interrupt will still be seen in status register when enabled
239 * '1' for intr masked '0' for intr unmasked)
240 * @param[in] pEGPIO : Pointer to the EGPIO register instance
241 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
242 * @return None
243 */
RSI_EGPIO_IntMask(EGPIO_Type * pEGPIO,uint8_t intCh)244 STATIC INLINE void RSI_EGPIO_IntMask(EGPIO_Type *pEGPIO, uint8_t intCh)
245 {
246 #if defined(ROMDRIVER_PRESENT)
247 ROMAPI_EGPIO_API->egpio_int_mask(pEGPIO, intCh);
248 #else
249 egpio_int_mask(pEGPIO, intCh);
250 #endif
251 }
252
253 /**
254 * @fn STATIC INLINE void RSI_EGPIO_IntUnMask(EGPIO_Type *pEGPIO ,uint8_t intCh)
255 * @brief This API is used to used to set the pin interrupt mode configuration
256 * \n(UnMasks the interrupt.
257 * @param[in] pEGPIO : Pointer to the EGPIO register instance
258 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
259 * @return None
260 */
RSI_EGPIO_IntUnMask(EGPIO_Type * pEGPIO,uint8_t intCh)261 STATIC INLINE void RSI_EGPIO_IntUnMask(EGPIO_Type *pEGPIO, uint8_t intCh)
262 {
263 #if defined(ROMDRIVER_PRESENT)
264 ROMAPI_EGPIO_API->egpio_int_un_mask(pEGPIO, intCh);
265 #else
266 egpio_int_un_mask(pEGPIO, intCh);
267 #endif
268 }
269
270 /**
271 * @fn STATIC INLINE void RSI_EGPIO_SetIntLowLevelDisable(EGPIO_Type *pEGPIO ,uint8_t intCh)
272 * @brief This API is used to set the pin interrupt mode configuration
273 * \n(enables interrupt generation when pin level is 0 ,'1' for intr enabled '0' for disabled)
274 * @param[in] pEGPIO : Pointer to the EGPIO register instance
275 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
276 * @return None
277 */
RSI_EGPIO_SetIntLowLevelDisable(EGPIO_Type * pEGPIO,uint8_t intCh)278 STATIC INLINE void RSI_EGPIO_SetIntLowLevelDisable(EGPIO_Type *pEGPIO, uint8_t intCh)
279 {
280 #if defined(ROMDRIVER_PRESENT)
281 ROMAPI_EGPIO_API->egpio_set_int_low_level_disable(pEGPIO, intCh);
282 #else
283 egpio_set_int_low_level_disable(pEGPIO, intCh);
284 #endif
285 }
286
287 /**
288 * @fn STATIC INLINE void RSI_EGPIO_SetIntHighLevelEnable(EGPIO_Type *pEGPIO ,uint8_t intCh)
289 * @brief This API used to set the pin interrupt mode configuration
290 * \n(enables interrupt generation when pin level is 1, '1' for intr enabled '0' for disabled)
291 * @param[in] pEGPIO : Pointer to the EGPIO register instance
292 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
293 * @return None
294 */
RSI_EGPIO_SetIntHighLevelEnable(EGPIO_Type * pEGPIO,uint8_t intCh)295 STATIC INLINE void RSI_EGPIO_SetIntHighLevelEnable(EGPIO_Type *pEGPIO, uint8_t intCh)
296 {
297 #if defined(ROMDRIVER_PRESENT)
298 ROMAPI_EGPIO_API->egpio_set_int_high_level_enable(pEGPIO, intCh);
299 #else
300 egpio_set_int_high_level_enable(pEGPIO, intCh);
301 #endif
302 }
303
304 /**
305 * @fn STATIC INLINE void RSI_EGPIO_SetIntHighLevelDisable(EGPIO_Type *pEGPIO ,uint8_t intCh)
306 * @brief This API is used to used to set the pin interrupt mode configuration
307 \n(disables interrupt generation when pin level is 1 ,'1' for intr enabled '0' for disabled)
308 * @param[in] pEGPIO : Pointer to the EGPIO register instance
309 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
310 * @return None
311 */
RSI_EGPIO_SetIntHighLevelDisable(EGPIO_Type * pEGPIO,uint8_t intCh)312 STATIC INLINE void RSI_EGPIO_SetIntHighLevelDisable(EGPIO_Type *pEGPIO, uint8_t intCh)
313 {
314 #if defined(ROMDRIVER_PRESENT)
315 ROMAPI_EGPIO_API->egpio_set_int_high_level_disable(pEGPIO, intCh);
316 #else
317 egpio_set_int_high_level_disable(pEGPIO, intCh);
318 #endif
319 }
320
321 /**
322 * @fn uint8_t RSI_EGPIO_GetIntStat(const EGPIO_Type *pEGPIO ,uint8_t intCh)
323 * @brief This API is used to get the pin interrupt status register
324 * @param[in] pEGPIO : Pointer to the EGPIO register instance
325 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
326 * @return returns the interrupt status register
327 */
RSI_EGPIO_GetIntStat(const EGPIO_Type * pEGPIO,uint8_t intCh)328 STATIC INLINE uint8_t RSI_EGPIO_GetIntStat(const EGPIO_Type *pEGPIO, uint8_t intCh)
329 {
330 #if defined(ROMDRIVER_PRESENT)
331 return ROMAPI_EGPIO_API->egpio_get_int_stat(pEGPIO, intCh);
332 #else
333 return egpio_get_int_stat(pEGPIO, intCh);
334 #endif
335 }
336
337 /**
338 * @fn STATIC INLINE void RSI_EGPIO_IntClr(EGPIO_Type *pEGPIO ,uint8_t intCh , uint8_t flags)
339 * @brief This API is used to clear the pin interrupt in status register
340 * @param[in] pEGPIO : Pointer to the EGPIO register instance
341 * @param[in] intCh : GPIO pin interrupt channel number (0 to 7)
342 * @param[in] flags : GPIO pin interrupt channel number (0 to 7)
343 \n 2- \ref EGPIO_PIN_INT_CLR_FALLING
344 \n 1- \ref EGPIO_PIN_INT_CLR_RISING
345 \n 0- \ref INTERRUPT_STATUS_CLR
346 * @return None
347 */
RSI_EGPIO_IntClr(EGPIO_Type * pEGPIO,uint8_t intCh,uint8_t flags)348 STATIC INLINE void RSI_EGPIO_IntClr(EGPIO_Type *pEGPIO, uint8_t intCh, uint8_t flags)
349 {
350 #if defined(ROMDRIVER_PRESENT)
351 ROMAPI_EGPIO_API->egpio_int_clr(pEGPIO, intCh, flags);
352 #else
353 egpio_int_clr(pEGPIO, intCh, flags);
354 #endif
355 }
356
357 /**
358 * @fn STATIC INLINE void RSI_EGPIO_SetPinMux(EGPIO_Type *pEGPIO ,uint8_t port , uint8_t pin , uint8_t mux)
359 * @brief This API to used to set pin multiplexing
360 * \n(GPIO Pin Mode. Ranges 000 -> Mode 0 to 111 -> Mode 7 Used for GPIO Pin Muxing)
361 * @param[in] pEGPIO : Pointer to the EGPIO register instance
362 * @param[in] port : GPIO port number
363 * @param[in] pin : GPIO pin number
364 * @param[in] mux : pin function value
365 * \n possible values for this parameter are the following
366 * - \ref EGPIO_PIN_MUX_MODE0 : Select pin mode 0
367 * - \ref EGPIO_PIN_MUX_MODE1 : Select pin mode 1
368 * - \ref EGPIO_PIN_MUX_MODE2 : Select pin mode 2
369 * - \ref EGPIO_PIN_MUX_MODE3 : Select pin mode 3
370 * - \ref EGPIO_PIN_MUX_MODE4 : Select pin mode 4
371 * - \ref EGPIO_PIN_MUX_MODE5 : Select pin mode 5
372 * - \ref EGPIO_PIN_MUX_MODE6 : Select pin mode 6
373 * - \ref EGPIO_PIN_MUX_MODE7 : Select pin mode 7
374 * - \ref EGPIO_PIN_MUX_MODE8 : Select pin mode 8
375 * - \ref EGPIO_PIN_MUX_MODE9 : Select pin mode 9
376 * - \ref EGPIO_PIN_MUX_MODE10 : Select pin mode 10
377 * - \ref EGPIO_PIN_MUX_MODE11 : Select pin mode 11
378 * - \ref EGPIO_PIN_MUX_MODE12 : Select pin mode 12
379 * - \ref EGPIO_PIN_MUX_MODE13 : Select pin mode 13
380 * - \ref EGPIO_PIN_MUX_MODE14 : Select pin mode 14
381 * - \ref EGPIO_PIN_MUX_MODE15 : Select pin mode 15
382 * @return None
383 */
RSI_EGPIO_SetPinMux(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin,uint8_t mux)384 STATIC INLINE void RSI_EGPIO_SetPinMux(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin, uint8_t mux)
385 {
386 #if defined(ROMDRIVER_PRESENT)
387 ROMAPI_EGPIO_API->egpio_set_pin_mux(pEGPIO, port, pin, mux);
388 #else
389 egpio_set_pin_mux(pEGPIO, port, pin, mux);
390 #endif
391 }
392
393 /**
394 * @fn STATIC INLINE void RSI_EGPIO_UlpSocGpioMode(ULPCLK_Type *pULPCLK,uint8_t gpio,uint8_t mode)
395 * @brief This API is used set ulp soc gpio mode
396 * \n(Gpio pin mode,ranges 000 -> Mode 0 to 111 -> Mode 7 Used for GPIO Pin Muxing )
397 * @param[in] pULPCLK : Pointer to the ULP register instance
398 * @param[in] gpio : Gpio number
399 * @param[in] mode : GPIO mode
400 * \n possible values for this parameter are the following
401 * - \ref EGPIO_PIN_MUX_MODE0 : Select pin mode 0
402 * - \ref EGPIO_PIN_MUX_MODE1 : Select pin mode 1
403 * - \ref EGPIO_PIN_MUX_MODE2 : Select pin mode 2
404 * - \ref EGPIO_PIN_MUX_MODE3 : Select pin mode 3
405 * - \ref EGPIO_PIN_MUX_MODE4 : Select pin mode 4
406 * - \ref EGPIO_PIN_MUX_MODE5 : Select pin mode 5
407 * - \ref EGPIO_PIN_MUX_MODE6 : Select pin mode 6
408 * - \ref EGPIO_PIN_MUX_MODE7 : Select pin mode 7
409 * @return None
410 */
RSI_EGPIO_UlpSocGpioMode(ULPCLK_Type * pULPCLK,uint8_t gpio,uint8_t mode)411 STATIC INLINE void RSI_EGPIO_UlpSocGpioMode(ULPCLK_Type *pULPCLK, uint8_t gpio, uint8_t mode)
412 {
413 #if defined(ROMDRIVER_PRESENT)
414 ROMAPI_EGPIO_API->egpio_ulp_soc_gpio_mode(pULPCLK, gpio, mode);
415 #else
416 egpio_ulp_soc_gpio_mode(pULPCLK, gpio, mode);
417 #endif
418 }
419
420 /**
421 * @fn STATIC INLINE void RSI_EGPIO_SetPortMask(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin)
422 * @brief This API is used to set the EGPIO port mask. When set, pin is masked when written/read through PORT MASK REG.
423 * @param[in] pEGPIO : Pointer to the EGPIO register instance
424 * @param[in] port : GPIO port number
425 * @param[in] pin : GPIO pin number
426 * @return None
427 */
RSI_EGPIO_SetPortMask(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)428 STATIC INLINE void RSI_EGPIO_SetPortMask(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
429 {
430 #if defined(ROMDRIVER_PRESENT)
431 ROMAPI_EGPIO_API->egpio_set_port_mask(pEGPIO, port, pin);
432 #else
433 egpio_set_port_mask(pEGPIO, port, pin);
434 #endif
435 }
436
437 /**
438 * @fn STATIC INLINE void RSI_EGPIO_SetPortUnMask(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin)
439 * @brief This API is used to set the EGPIO port unmask. When set, pin is masked when written/read through PORT MASK REG.
440 * @param[in] pEGPIO : Pointer to the EGPIO register instance
441 * @param[in] port : GPIO port number
442 * @param[in] pin : GPIO pin number
443 * @return None
444 */
RSI_EGPIO_SetPortUnMask(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)445 STATIC INLINE void RSI_EGPIO_SetPortUnMask(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
446 {
447 #if defined(ROMDRIVER_PRESENT)
448 ROMAPI_EGPIO_API->egpio_set_port_un_mask(pEGPIO, port, pin);
449 #else
450 egpio_set_port_un_mask(pEGPIO, port, pin);
451 #endif
452 }
453
454 /**
455 * @fn STATIC INLINE void RSI_EGPIO_PortMaskedLoad(EGPIO_Type *pEGPIO ,uint8_t port, uint16_t val)
456 * @brief This API is used to set the EGPIO port mask load. When set, pin is masked when written/read through PORT MASK REG.
457 * @param[in] pEGPIO : Pointer to the EGPIO register instance
458 * @param[in] port : GPIO port number
459 * @param[in] val : Port value to be set
460 * @return None
461 */
RSI_EGPIO_PortMaskedLoad(EGPIO_Type * pEGPIO,uint8_t port,uint16_t val)462 STATIC INLINE void RSI_EGPIO_PortMaskedLoad(EGPIO_Type *pEGPIO, uint8_t port, uint16_t val)
463 {
464 #if defined(ROMDRIVER_PRESENT)
465 ROMAPI_EGPIO_API->egpio_port_masked_load(pEGPIO, port, val);
466 #else
467 egpio_port_masked_load(pEGPIO, port, val);
468 #endif
469 }
470
471 /**
472 * @fn STATIC INLINE void RSI_EGPIO_SetPort(EGPIO_Type *pEGPIO ,uint8_t port , uint16_t val)
473 * @brief This API is used to set the port value.
474 * Sets the pin when corresponding bit is high. Writing zero has no effect
475 * @param[in] pEGPIO : Pointer to the EGPIO register instance
476 * @param[in] port : Port number to the EGPIO register instance
477 * @param[in] val : Port value to be set
478 * @return None
479 */
RSI_EGPIO_SetPort(EGPIO_Type * pEGPIO,uint8_t port,uint16_t val)480 STATIC INLINE void RSI_EGPIO_SetPort(EGPIO_Type *pEGPIO, uint8_t port, uint16_t val)
481 {
482 #if defined(ROMDRIVER_PRESENT)
483 ROMAPI_EGPIO_API->egpio_set_port(pEGPIO, port, val);
484 #else
485 egpio_set_port(pEGPIO, port, val);
486 #endif
487 }
488
489 /**
490 * @fn STATIC INLINE void RSI_EGPIO_PortLoad(EGPIO_Type *pEGPIO ,uint8_t port , uint16_t val)
491 * @brief This API is used to load the port value.
492 * Loads the value on to pin on write. And reads the value of load register on read
493 * @param[in] pEGPIO : Pointer to the EGPIO register instance
494 * @param[in] port : Port number to the EGPIO register instance
495 * @param[in] val : Port value to be set
496 * @return None
497 */
RSI_EGPIO_PortLoad(EGPIO_Type * pEGPIO,uint8_t port,uint16_t val)498 STATIC INLINE void RSI_EGPIO_PortLoad(EGPIO_Type *pEGPIO, uint8_t port, uint16_t val)
499 {
500 #if defined(ROMDRIVER_PRESENT)
501 ROMAPI_EGPIO_API->egpio_port_load(pEGPIO, port, val);
502 #else
503 egpio_port_load(pEGPIO, port, val);
504 #endif
505 }
506
507 /**
508 * @fn STATIC INLINE void RSI_EGPIO_WordLoad(EGPIO_Type *pEGPIO ,uint8_t pin , uint16_t val)
509 * @brief This API is used to load the port value.
510 * Loads 1 on the pin when any of the bit in load value is 1. On read pass the bit status into all bits.
511 * @param[in] pEGPIO : Pointer to the EGPIO register instance
512 * @param[in] pin : pin number to the EGPIO register instance
513 * @param[in] val : Port value to be set
514 * @return None
515 */
RSI_EGPIO_WordLoad(EGPIO_Type * pEGPIO,uint8_t pin,uint16_t val)516 STATIC INLINE void RSI_EGPIO_WordLoad(EGPIO_Type *pEGPIO, uint8_t pin, uint16_t val)
517 {
518 #if defined(ROMDRIVER_PRESENT)
519 ROMAPI_EGPIO_API->egpio_word_load(pEGPIO, pin, val);
520 #else
521 egpio_word_load(pEGPIO, pin, val);
522 #endif
523 }
524
525 /**
526 * @fn STATIC INLINE void RSI_EGPIO_ClrPort(EGPIO_Type *pEGPIO ,uint8_t port , uint16_t val)
527 * @brief This API is used to clear the port value.
528 * Clears the pin when corresponding bit is high. Writing zero has no effect.
529 * @param[in] pEGPIO : Pointer to the EGPIO register instance
530 * @param[in] port : Port number
531 * @param[in] val : Port value to be clear
532 * @return None
533 */
RSI_EGPIO_ClrPort(EGPIO_Type * pEGPIO,uint8_t port,uint16_t val)534 STATIC INLINE void RSI_EGPIO_ClrPort(EGPIO_Type *pEGPIO, uint8_t port, uint16_t val)
535 {
536 #if defined(ROMDRIVER_PRESENT)
537 ROMAPI_EGPIO_API->egpio_clr_port(pEGPIO, port, val);
538 #else
539 egpio_clr_port(pEGPIO, port, val);
540 #endif
541 }
542
543 /**
544 * @fn STATIC INLINE void RSI_EGPIO_TogglePort(EGPIO_Type *pEGPIO ,uint8_t port , uint16_t val)
545 * @brief This API is used to toggle the port.
546 * Toggles the pin when corresponding bit is high. Writing zero has not effect.
547 * @param[in] pEGPIO : Pointer to the EGPIO register instance
548 * @param[in] port : Port number
549 * @param[in] val : Port value to be toggle
550 * @return None
551 */
RSI_EGPIO_TogglePort(EGPIO_Type * pEGPIO,uint8_t port,uint16_t val)552 STATIC INLINE void RSI_EGPIO_TogglePort(EGPIO_Type *pEGPIO, uint8_t port, uint16_t val)
553 {
554 #if defined(ROMDRIVER_PRESENT)
555 ROMAPI_EGPIO_API->egpio_toggle_port(pEGPIO, port, val);
556 #else
557 egpio_toggle_port(pEGPIO, port, val);
558 #endif
559 }
560
561 /**
562 * @fn STATIC INLINE uint16_t RSI_EGPIO_GetPort(const EGPIO_Type *pEGPIO ,uint8_t port)
563 * @brief This API is used to used to get the EGPIO port value.
564 * Reads the value on GPIO pins irrespective of the pin mode.
565 * @param[in] pEGPIO : Pointer to the EGPIO register instance
566 * @param[in] port : Port number to be read
567 * @return port value
568 */
RSI_EGPIO_GetPort(const EGPIO_Type * pEGPIO,uint8_t port)569 STATIC INLINE uint16_t RSI_EGPIO_GetPort(const EGPIO_Type *pEGPIO, uint8_t port)
570 {
571 #if defined(ROMDRIVER_PRESENT)
572 return ROMAPI_EGPIO_API->egpio_get_port(pEGPIO, port);
573 #else
574 return egpio_get_port(pEGPIO, port);
575 #endif
576 }
577
578 /**
579 * @fn STATIC INLINE void RSI_EGPIO_GroupIntOneEnable(EGPIO_Type *pEGPIO,uint8_t port,uint8_t pin)
580 * @brief This API is used to enable the group interrupt one , When set,
581 * the corresponding GPIO pin is selected for group interrupt 1 generation
582 * @param[in] pEGPIO : Pointer to the EGPIO register instance
583 * @param[in] port : GPIO port number
584 * @param[in] pin : GPIO pin number
585 * @return None
586 */
RSI_EGPIO_GroupIntOneEnable(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)587 STATIC INLINE void RSI_EGPIO_GroupIntOneEnable(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
588 {
589 #if defined(ROMDRIVER_PRESENT)
590 ROMAPI_EGPIO_API->egpio_group_int_one_enable(pEGPIO, port, pin);
591 #else
592 egpio_group_int_one_enable(pEGPIO, port, pin);
593 #endif
594 }
595
596 /**
597 * @fn STATIC INLINE void RSI_EGPIO_GroupIntOneDisable(EGPIO_Type *pEGPIO,uint8_t port,uint8_t pin)
598 * @brief This API is used to disable the group interrupt one
599 * @param[in] pEGPIO : Pointer to the EGPIO register instance
600 * @param[in] port : GPIO port number
601 * @param[in] pin : GPIO pin number
602 * @return None
603 */
RSI_EGPIO_GroupIntOneDisable(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)604 STATIC INLINE void RSI_EGPIO_GroupIntOneDisable(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
605 {
606 #if defined(ROMDRIVER_PRESENT)
607 ROMAPI_EGPIO_API->egpio_group_int_one_disable(pEGPIO, port, pin);
608 #else
609 egpio_group_int_one_disable(pEGPIO, port, pin);
610 #endif
611 }
612
613 /**
614 * @fn STATIC INLINE void RSI_EGPIO_GroupIntTwoEnable(EGPIO_Type *pEGPIO,uint8_t port,uint8_t pin)
615 * @brief This API is used to enable the group interrupt Two , When set,
616 * the corresponding GPIO pin is selected for group interrupt 2 generation
617 * @param[in] pEGPIO : Pointer to the EGPIO register instance
618 * @param[in] port : GPIO port number
619 * @param[in] pin : GPIO pin number
620 * @return None
621 */
RSI_EGPIO_GroupIntTwoEnable(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)622 STATIC INLINE void RSI_EGPIO_GroupIntTwoEnable(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
623 {
624 #if defined(ROMDRIVER_PRESENT)
625 ROMAPI_EGPIO_API->egpio_group_int_two_enable(pEGPIO, port, pin);
626 #else
627 egpio_group_int_two_enable(pEGPIO, port, pin);
628 #endif
629 }
630
631 /**
632 * @fn STATIC INLINE void RSI_EGPIO_GroupIntMask(EGPIO_Type *pEGPIO ,uint8_t grpInt)
633 * @brief This API is used to configure the group interrupts(1-mask,0-unmask)
634 * @param[in] pEGPIO : Pointer to the EGPIO register instance
635 * @param[in] grpInt : Group interrupt number
636 * @return None
637 */
RSI_EGPIO_GroupIntMask(EGPIO_Type * pEGPIO,uint8_t grpInt)638 STATIC INLINE void RSI_EGPIO_GroupIntMask(EGPIO_Type *pEGPIO, uint8_t grpInt)
639 {
640 #if defined(ROMDRIVER_PRESENT)
641 ROMAPI_EGPIO_API->egpio_group_int_mask(pEGPIO, grpInt);
642 #else
643 egpio_group_int_mask(pEGPIO, grpInt);
644 #endif
645 }
646
647 /**
648 * @fn STATIC INLINE void RSI_EGPIO_GroupIntUnMask(EGPIO_Type *pEGPIO ,uint8_t grpInt)
649 * @brief This API is used to configure the group interrupts(1-mask,0-unmask)
650 * @param[in] pEGPIO : Pointer to the EGPIO register instance
651 * @param[in] grpInt : Group interrupt number
652 * @return None
653 */
RSI_EGPIO_GroupIntUnMask(EGPIO_Type * pEGPIO,uint8_t grpInt)654 STATIC INLINE void RSI_EGPIO_GroupIntUnMask(EGPIO_Type *pEGPIO, uint8_t grpInt)
655 {
656 #if defined(ROMDRIVER_PRESENT)
657 ROMAPI_EGPIO_API->egpio_group_int_un_Mask(pEGPIO, grpInt);
658 #else
659 egpio_group_int_un_Mask(pEGPIO, grpInt);
660 #endif
661 }
662
663 /**
664 * @fn STATIC INLINE void RSI_EGPIO_GroupIntEnable(EGPIO_Type *pEGPIO ,uint8_t grpInt)
665 * @brief This API is used to configure the group interrupts(1-enable, 0-disable)
666 * @param[in] pEGPIO : Pointer to the EGPIO register instance
667 * @param[in] grpInt : Group interrupt number
668 * @return None
669 */
RSI_EGPIO_GroupIntEnable(EGPIO_Type * pEGPIO,uint8_t grpInt)670 STATIC INLINE void RSI_EGPIO_GroupIntEnable(EGPIO_Type *pEGPIO, uint8_t grpInt)
671 {
672 #if defined(ROMDRIVER_PRESENT)
673 ROMAPI_EGPIO_API->egpio_group_int_enable(pEGPIO, grpInt);
674 #else
675 egpio_group_int_enable(pEGPIO, grpInt);
676 #endif
677 }
678
679 /**
680 * @fn STATIC INLINE void RSI_EGPIO_GroupIntDisable(EGPIO_Type *pEGPIO ,uint8_t grpInt)
681 * @brief This API is used to configure the group interrupts(1-enable, 0-disable)
682 * @param[in] pEGPIO : Pointer to the EGPIO register instance
683 * @param[in] grpInt : Group interrupt number
684 * @return None
685 */
RSI_EGPIO_GroupIntDisable(EGPIO_Type * pEGPIO,uint8_t grpInt)686 STATIC INLINE void RSI_EGPIO_GroupIntDisable(EGPIO_Type *pEGPIO, uint8_t grpInt)
687 {
688 #if defined(ROMDRIVER_PRESENT)
689 ROMAPI_EGPIO_API->egpio_group_int_disable(pEGPIO, grpInt);
690 #else
691 egpio_group_int_disable(pEGPIO, grpInt);
692 #endif
693 }
694
695 /**
696 * @fn STATIC INLINE void RSI_EGPIO_GroupIntLevel(EGPIO_Type *pEGPIO ,uint8_t grpInt)
697 * @brief This API is used to configure the group interrupts(0-level,1-edge)
698 * @param[in] pEGPIO : Pointer to the EGPIO register instance
699 * @param[in] grpInt : Group interrupt number
700 * @return None
701 */
RSI_EGPIO_GroupIntLevel(EGPIO_Type * pEGPIO,uint8_t grpInt)702 STATIC INLINE void RSI_EGPIO_GroupIntLevel(EGPIO_Type *pEGPIO, uint8_t grpInt)
703 {
704 #if defined(ROMDRIVER_PRESENT)
705 ROMAPI_EGPIO_API->egpio_group_int_level(pEGPIO, grpInt);
706 #else
707 egpio_group_int_level(pEGPIO, grpInt);
708 #endif
709 }
710
711 /**
712 * @fn STATIC INLINE void RSI_EGPIO_GroupIntEdge(EGPIO_Type *pEGPIO ,uint8_t grpInt)
713 * @brief This API is used to configure the group interrupts(0-level,1-edge)
714 * @param[in] pEGPIO : Pointer to the EGPIO register instance
715 * @param[in] grpInt : Group interrupt number
716 * @return None
717 */
RSI_EGPIO_GroupIntEdge(EGPIO_Type * pEGPIO,uint8_t grpInt)718 STATIC INLINE void RSI_EGPIO_GroupIntEdge(EGPIO_Type *pEGPIO, uint8_t grpInt)
719 {
720 #if defined(ROMDRIVER_PRESENT)
721 ROMAPI_EGPIO_API->egpio_group_int_edge(pEGPIO, grpInt);
722 #else
723 egpio_group_int_edge(pEGPIO, grpInt);
724 #endif
725 }
726
727 /**
728 * @fn STATIC INLINE void RSI_EGPIO_GroupIntAnd(EGPIO_Type *pEGPIO ,uint8_t grpInt)
729 * @brief This API is used to configure the group interrupts(0-AND ,1-Or)
730 * @param[in] pEGPIO : Pointer to the EGPIO register instance
731 * @param[in] grpInt : Group interrupt number
732 * @return None
733 */
RSI_EGPIO_GroupIntAnd(EGPIO_Type * pEGPIO,uint8_t grpInt)734 STATIC INLINE void RSI_EGPIO_GroupIntAnd(EGPIO_Type *pEGPIO, uint8_t grpInt)
735 {
736 #if defined(ROMDRIVER_PRESENT)
737 ROMAPI_EGPIO_API->egpio_group_int_and(pEGPIO, grpInt);
738 #else
739 egpio_group_int_and(pEGPIO, grpInt);
740 #endif
741 }
742
743 /**
744 * @fn STATIC INLINE void RSI_EGPIO_GroupIntOr(EGPIO_Type *pEGPIO ,uint8_t grpInt)
745 * @brief This API is used to configure the group interrupts(0- AND , 1-Or)
746 * @param[in] pEGPIO : Pointer to the EGPIO register instance
747 * @param[in] grpInt : Group interrupt number
748 * @return None
749 */
RSI_EGPIO_GroupIntOr(EGPIO_Type * pEGPIO,uint8_t grpInt)750 STATIC INLINE void RSI_EGPIO_GroupIntOr(EGPIO_Type *pEGPIO, uint8_t grpInt)
751 {
752 #if defined(ROMDRIVER_PRESENT)
753 ROMAPI_EGPIO_API->egpio_group_int_or(pEGPIO, grpInt);
754 #else
755 egpio_group_int_or(pEGPIO, grpInt);
756 #endif
757 }
758
759 /**
760 * @fn STATIC INLINE uint32_t RSI_EGPIO_GroupIntStat(const EGPIO_Type *pEGPIO ,uint8_t grpInt)
761 * @brief This API to used to get the group interrupt status
762 * @param[in] pEGPIO : Pointer to the EGPIO register instance
763 * @param[in] grpInt : Group interrupt number
764 * @return returns the group interrupt status register
765 */
RSI_EGPIO_GroupIntStat(const EGPIO_Type * pEGPIO,uint8_t grpInt)766 STATIC INLINE uint32_t RSI_EGPIO_GroupIntStat(const EGPIO_Type *pEGPIO, uint8_t grpInt)
767 {
768 #if defined(ROMDRIVER_PRESENT)
769 return ROMAPI_EGPIO_API->egpio_group_int_stat(pEGPIO, grpInt);
770 #else
771 return egpio_group_int_stat(pEGPIO, grpInt);
772 #endif
773 }
774
775 /**
776 * @fn STATIC INLINE void RSI_EGPIO_GroupIntWkeUpEnable(EGPIO_Type *pEGPIO ,uint8_t grpInt)
777 * @brief This API to used to Enable the group interrupt wakeup interrupt
778 * @param[in] pEGPIO : Pointer to the EGPIO register instance
779 * @param[in] grpInt : Group interrupt number
780 * @return None
781 */
RSI_EGPIO_GroupIntWkeUpEnable(EGPIO_Type * pEGPIO,uint8_t grpInt)782 STATIC INLINE void RSI_EGPIO_GroupIntWkeUpEnable(EGPIO_Type *pEGPIO, uint8_t grpInt)
783 {
784 #if defined(ROMDRIVER_PRESENT)
785 ROMAPI_EGPIO_API->egpio_group_int_wkeup_Enable(pEGPIO, grpInt);
786 #else
787 egpio_group_int_wkeup_Enable(pEGPIO, grpInt);
788 #endif
789 }
790
791 /**
792 * @fn STATIC INLINE void RSI_EGPIO_GroupIntWkeUpDisable(EGPIO_Type *pEGPIO ,uint8_t grpInt)
793 * @brief This API to used to Disable the group interrupt wakeup interrupt
794 * @param[in] pEGPIO : Pointer to the EGPIO register instance
795 * @param[in] grpInt : Group interrupt number
796 * @return None
797 */
RSI_EGPIO_GroupIntWkeUpDisable(EGPIO_Type * pEGPIO,uint8_t grpInt)798 STATIC INLINE void RSI_EGPIO_GroupIntWkeUpDisable(EGPIO_Type *pEGPIO, uint8_t grpInt)
799 {
800 #if defined(ROMDRIVER_PRESENT)
801 ROMAPI_EGPIO_API->egpio_group_int_wkeup_disable(pEGPIO, grpInt);
802 #else
803 egpio_group_int_wkeup_disable(pEGPIO, grpInt);
804 #endif
805 }
806
807 /**
808 * @fn STATIC INLINE void RSI_EGPIO_GroupIntClr(EGPIO_Type *pEGPIO ,uint8_t grpInt , uint8_t flags)
809 * @brief This API is used to used to clear the group interrupt status
810 * @param[in] pEGPIO : Pointer to the EGPIO register instance
811 * @param[in] grpInt : Group interrupt number
812 * @param[in] flags : clear flags
813 * @return None
814 */
RSI_EGPIO_GroupIntClr(EGPIO_Type * pEGPIO,uint8_t grpInt,uint8_t flags)815 STATIC INLINE void RSI_EGPIO_GroupIntClr(EGPIO_Type *pEGPIO, uint8_t grpInt, uint8_t flags)
816 {
817 #if defined(ROMDRIVER_PRESENT)
818 ROMAPI_EGPIO_API->egpio_group_int_clr(pEGPIO, grpInt, flags);
819 #else
820 egpio_group_int_clr(pEGPIO, grpInt, flags);
821 #endif
822 }
823
824 /**
825 * @fn STATIC INLINE void RSI_EGPIO_GroupIntTwoDisable(EGPIO_Type *pEGPIO ,uint8_t port ,uint8_t pin)
826 * @brief This API is used to used to disable the group interrupt two
827 * @param[in] pEGPIO : Pointer to the EGPIO register instance
828 * @param[in] port : PORT number
829 * @param[in] pin : PIN number
830 * @return None
831 */
RSI_EGPIO_GroupIntTwoDisable(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin)832 STATIC INLINE void RSI_EGPIO_GroupIntTwoDisable(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin)
833 {
834 #if defined(ROMDRIVER_PRESENT)
835 ROMAPI_EGPIO_API->egpio_group_int_two_disable(pEGPIO, port, pin);
836 #else
837 egpio_group_int_two_disable(pEGPIO, port, pin);
838 #endif
839 }
840
841 /**
842 * @fn STATIC INLINE void RSI_EGPIO_SetGroupIntOnePol(EGPIO_Type *pEGPIO ,uint8_t port , uint8_t pin , uint8_t pol)
843 * @brief This API is used to set the group polarity of interrupt one.
844 * Decides the active value of the pin to be considered for group interrupt 1 generation when enabled
845 * @param[in] pEGPIO : Pointer to the EGPIO register instance
846 * @param[in] port : PORT number
847 * @param[in] pin : PIN number
848 * @param[in] pol : Polarity of interrupt
849 * \n '0' : group interrupt gets generated when GPIO input pin status is '0'.
850 * \n '1' : group interrupt gets generated when GPIO input pin status is '1'
851 * @return None
852 */
RSI_EGPIO_SetGroupIntOnePol(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin,uint8_t pol)853 STATIC INLINE void RSI_EGPIO_SetGroupIntOnePol(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin, uint8_t pol)
854 {
855 #if defined(ROMDRIVER_PRESENT)
856 ROMAPI_EGPIO_API->egpio_set_group_int_one_pol(pEGPIO, port, pin, pol);
857 #else
858 egpio_set_group_int_one_pol(pEGPIO, port, pin, pol);
859 #endif
860 }
861
862 /**
863 * @fn STATIC INLINE void RSI_EGPIO_SetGroupIntTwoPol(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin , uint8_t pol)
864 * @brief This API is used to set the group polarity of interrupt two.
865 * Decides the active value of the pin to be considered for group interrupt 2 generation when enabled
866 * @param[in] pEGPIO : Pointer to the EGPIO register instance
867 * @param[in] port : PORT number
868 * @param[in] pin : PIN number
869 * @param[in] pol : Polarity of interrupt
870 * \n '0' : group interrupt gets generated when GPIO input pin status is '0'.
871 * \n '1' : group interrupt gets generated when GPIO input pin status is '1'.
872 * @return None
873 */
RSI_EGPIO_SetGroupIntTwoPol(EGPIO_Type * pEGPIO,uint8_t port,uint8_t pin,uint8_t pol)874 STATIC INLINE void RSI_EGPIO_SetGroupIntTwoPol(EGPIO_Type *pEGPIO, uint8_t port, uint8_t pin, uint8_t pol)
875 {
876 #if defined(ROMDRIVER_PRESENT)
877 ROMAPI_EGPIO_API->egpio_set_group_int_two_pol(pEGPIO, port, pin, pol);
878 #else
879 egpio_set_group_int_two_pol(pEGPIO, port, pin, pol);
880 #endif
881 }
882
883 /**
884 * @fn STATIC INLINE void RSI_EGPIO_HostPadsGpioModeEnable(uint8_t u8GpioNum)
885 * @brief This API is used to select the host pad gpios(25 to 30)
886 * @param[in] u8GpioNum : PAD number to be use
887 * @return None
888 */
RSI_EGPIO_HostPadsGpioModeEnable(uint8_t u8GpioNum)889 STATIC INLINE void RSI_EGPIO_HostPadsGpioModeEnable(uint8_t u8GpioNum)
890 {
891 #if defined(ROMDRIVER_PRESENT)
892 ROMAPI_EGPIO_API->egpio_host_pads_gpio_mode_enable(u8GpioNum);
893 #else
894 egpio_host_pads_gpio_mode_enable(u8GpioNum);
895 #endif
896 }
897
898 /**
899 * @fn STATIC INLINE void RSI_EGPIO_HostPadsGpioModeDisable(uint8_t u8GpioNum)
900 * @brief This API is used to deselect the host pad gpios(25 to 30)
901 * @param[in] u8GpioNum : PAD number to be use
902 * @return None
903 */
RSI_EGPIO_HostPadsGpioModeDisable(uint8_t u8GpioNum)904 STATIC INLINE void RSI_EGPIO_HostPadsGpioModeDisable(uint8_t u8GpioNum)
905 {
906 #if defined(ROMDRIVER_PRESENT)
907 ROMAPI_EGPIO_API->egpio_host_pads_gpio_mode_disable(u8GpioNum);
908 #else
909 egpio_host_pads_gpio_mode_disable(u8GpioNum);
910 #endif
911 }
912
913 /**
914 * @fn STATIC INLINE void RSI_EGPIO_PadSelectionEnable(uint8_t padNum)
915 * @brief This API is used to select the pad(0 to 21)
916 * @param[in] padNum : PAD number to be use
917 * @return None
918 */
RSI_EGPIO_PadSelectionEnable(uint8_t padNum)919 STATIC INLINE void RSI_EGPIO_PadSelectionEnable(uint8_t padNum)
920 {
921 #if defined(ROMDRIVER_PRESENT)
922 ROMAPI_EGPIO_API->egpio_pad_selection_enable(padNum);
923 #else
924 egpio_pad_selection_enable(padNum);
925 #endif
926 }
927
928 /**
929 * @fn STATIC INLINE void RSI_EGPIO_PadSelectionDisable(uint8_t padNum)
930 * @brief This API is used to deselect the pad(0 to 21)
931 * @param[in] padNum : PAD number to be use
932 * @return None
933 */
RSI_EGPIO_PadSelectionDisable(uint8_t padNum)934 STATIC INLINE void RSI_EGPIO_PadSelectionDisable(uint8_t padNum)
935 {
936 #if defined(ROMDRIVER_PRESENT)
937 ROMAPI_EGPIO_API->egpio_pad_selection_disable(padNum);
938 #else
939 egpio_pad_selection_disable(padNum);
940 #endif
941 }
942
943 /**
944 * @fn STATIC INLINE void RSI_EGPIO_PadReceiverEnable(uint8_t u8GpioNum)
945 * @brief This API is used to enable the receiver enable bit(REN)
946 * @param[in] u8GpioNum : GPIO num to be use
947 * @return None
948 */
RSI_EGPIO_PadReceiverEnable(uint8_t u8GpioNum)949 STATIC INLINE void RSI_EGPIO_PadReceiverEnable(uint8_t u8GpioNum)
950 {
951 #if defined(ROMDRIVER_PRESENT)
952 ROMAPI_EGPIO_API->egpio_pad_receiver_enable(u8GpioNum);
953 #else
954 egpio_pad_receiver_enable(u8GpioNum);
955 #endif
956 }
957
958 /**
959 * @fn STATIC INLINE void RSI_EGPIO_PadReceiverDisable(uint8_t u8GpioNum)
960 * @brief This API is used to Disable the receiver enable bit(REN)
961 * @param[in] u8GpioNum : GPIO num to be use
962 * @return None
963 */
RSI_EGPIO_PadReceiverDisable(uint8_t u8GpioNum)964 STATIC INLINE void RSI_EGPIO_PadReceiverDisable(uint8_t u8GpioNum)
965 {
966 #if defined(ROMDRIVER_PRESENT)
967 ROMAPI_EGPIO_API->egpio_pad_receiver_disable(u8GpioNum);
968 #else
969 egpio_pad_receiver_disable(u8GpioNum);
970 #endif
971 }
972
973 /**
974 * @fn STATIC INLINE void RSI_EGPIO_PadSdioConnected(void)
975 * @brief This API is used to use the SDIO pins(25 to 30) in M4 or NWP (0 for M4SS and 1 for TASS)
976 * @return None
977 */
RSI_EGPIO_PadSdioConnected(void)978 STATIC INLINE void RSI_EGPIO_PadSdioConnected(void)
979 {
980 #if defined(ROMDRIVER_PRESENT)
981 ROMAPI_EGPIO_API->egpio_pad_sdio_connected();
982 #else
983 egpio_pad_sdio_connected();
984 #endif
985 }
986
987 /**
988 * @fn void RSI_EGPIO_PadDriverDisableState(uint8_t u8GpioNum , en_driver_state_t endstate)
989 * @brief This API is used to control the Driver disabled state control
990 * @param[in] u8GpioNum : GPIO number to be use
991 * @param[in] endstate : the value to be passed
992 * \n possible values are
993 * \n - 0 for \ref HiZ (P1=0,P2=0)
994 * \n - 1 for \ref Pullup (P1=0,P2=1)
995 * \n - 2 for \ref Pulldown (P1=1,P2=0)
996 * \n - 3 for \ref Repeater (P1=1,P2=1)
997 * @return None
998 */
RSI_EGPIO_PadDriverDisableState(uint8_t u8GpioNum,en_driver_state_t endstate)999 STATIC INLINE void RSI_EGPIO_PadDriverDisableState(uint8_t u8GpioNum, en_driver_state_t endstate)
1000 {
1001 #if defined(ROMDRIVER_PRESENT)
1002 ROMAPI_EGPIO_API->egpio_pad_driver_disable_state(u8GpioNum, endstate);
1003 #else
1004 egpio_pad_driver_disable_state(u8GpioNum, endstate);
1005 #endif
1006 }
1007
1008 /**
1009 * @fn STATIC INLINE void RSI_EGPIO_PadDriverStrengthSelect(uint8_t u8GpioNum , en_driver_strength_select_t strength)
1010 * @brief This API is used to select Drive strength
1011 * @param[in] u8GpioNum : GPIO number to be use
1012 * @param[in] strength : Drive strength selector(E1,E2)
1013 * \n possible values are
1014 * \n - 0 for \ref two_milli_amps (E1=0,E2=0)
1015 * \n - 1 for \ref four_milli_amps (E1=0,E2=1)
1016 * \n - 2 for \ref eight_milli_amps (E1=1,E2=0)
1017 * \n - 3 for \ref twelve_milli_amps(E1=1,E2=1)
1018 * @return None
1019 */
RSI_EGPIO_PadDriverStrengthSelect(uint8_t u8GpioNum,en_driver_strength_select_t strength)1020 STATIC INLINE void RSI_EGPIO_PadDriverStrengthSelect(uint8_t u8GpioNum, en_driver_strength_select_t strength)
1021 {
1022 #if defined(ROMDRIVER_PRESENT)
1023 ROMAPI_EGPIO_API->egpio_pad_driver_strength_select(u8GpioNum, strength);
1024 #else
1025 egpio_pad_driver_strength_select(u8GpioNum, strength);
1026 #endif
1027 }
1028
1029 /**
1030 * @fn STATIC INLINE void RSI_EGPIO_PadPowerOnStartEnable(uint8_t u8GpioNum ,uint8_t val)
1031 * @brief This API is used to select Power on Start enable
1032 * @param[in] u8GpioNum : GPIO number to be use
1033 * @param[in] val : POS = 1 : Enables active pull down for invalid power;
1034 * \n : POS = 0 : Active pull down capability disabled .
1035 * \n When one of the power supplies is invalid and active high POS is set to 1,
1036 * \n AD is pulled to weak 0. When POS is set to 0, PAD remains in a high-Z state. : Default 0
1037 * @return None
1038 */
RSI_EGPIO_PadPowerOnStartEnable(uint8_t u8GpioNum,uint8_t val)1039 STATIC INLINE void RSI_EGPIO_PadPowerOnStartEnable(uint8_t u8GpioNum, uint8_t val)
1040 {
1041 #if defined(ROMDRIVER_PRESENT)
1042 ROMAPI_EGPIO_API->egpio_pad_power_on_start_enable(u8GpioNum, val);
1043 #else
1044 egpio_pad_power_on_start_enable(u8GpioNum, val);
1045 #endif
1046 }
1047
1048 /**
1049 * @fn STATIC INLINE void RSI_EGPIO_PadActiveHighSchmittTrigger(uint8_t u8GpioNum ,uint8_t val)
1050 * @brief Active high Schmitt trigger (Hysteresis) select;
1051 * \n SMT=0 for No hysteresis; Default value for reset is 1'b1 and others is 1'b0
1052 * @param[in] u8GpioNum : GPIO number to be use
1053 * @param[in] val : SMT=0 : No hysteresis; Default value for reset is 1'b1 and others is 1'b0
1054 * @return None
1055 */
RSI_EGPIO_PadActiveHighSchmittTrigger(uint8_t u8GpioNum,uint8_t val)1056 STATIC INLINE void RSI_EGPIO_PadActiveHighSchmittTrigger(uint8_t u8GpioNum, uint8_t val)
1057 {
1058 #if defined(ROMDRIVER_PRESENT)
1059 ROMAPI_EGPIO_API->egpio_pad_active_high_schmitt_trigger(u8GpioNum, val);
1060 #else
1061 egpio_pad_active_high_schmitt_trigger(u8GpioNum, val);
1062 #endif
1063 }
1064
1065 /**
1066 * @fn STATIC INLINE void RSI_EGPIO_PadSlewRateControll(uint8_t u8GpioNum ,uint8_t val)
1067 * @brief this API is used to control the slew rate
1068 * @param[in] u8GpioNum : GPIO number to be use
1069 * @param[in] val : slew rate
1070 * \n - SR = 0 : Slow (half frequency)
1071 \n - SR = 1 : Fast ,Default 1
1072 * @return None
1073 */
RSI_EGPIO_PadSlewRateControll(uint8_t u8GpioNum,uint8_t val)1074 STATIC INLINE void RSI_EGPIO_PadSlewRateControll(uint8_t u8GpioNum, uint8_t val)
1075 {
1076 #if defined(ROMDRIVER_PRESENT)
1077 ROMAPI_EGPIO_API->egpio_pad_slew_rate_controll(u8GpioNum, val);
1078 #else
1079 egpio_pad_slew_rate_controll(u8GpioNum, val);
1080 #endif
1081 }
1082
1083 /**
1084 * @fn STATIC INLINE void RSI_EGPIO_UlpPadReceiverEnable(uint8_t u8GpioNum)
1085 * @brief This API is used to enable the REN for ULP
1086 * @param[in] u8GpioNum : GPIO number to be used
1087 * @return None
1088 */
RSI_EGPIO_UlpPadReceiverEnable(uint8_t u8GpioNum)1089 STATIC INLINE void RSI_EGPIO_UlpPadReceiverEnable(uint8_t u8GpioNum)
1090 {
1091 #if defined(ROMDRIVER_PRESENT)
1092 ROMAPI_EGPIO_API->egpio_ulp_pad_receiver_enable(u8GpioNum);
1093 #else
1094 egpio_ulp_pad_receiver_enable(u8GpioNum);
1095 #endif
1096 }
1097
1098 /**
1099 * @fn STATIC INLINE void RSI_EGPIO_UlpPadReceiverDisable(uint8_t u8GpioNum)
1100 * @brief This API is used to enable the REN for ULP
1101 * @param[in] u8GpioNum : GPIO number to be used
1102 * @return None
1103 */
RSI_EGPIO_UlpPadReceiverDisable(uint8_t u8GpioNum)1104 STATIC INLINE void RSI_EGPIO_UlpPadReceiverDisable(uint8_t u8GpioNum)
1105 {
1106 #if defined(ROMDRIVER_PRESENT)
1107 ROMAPI_EGPIO_API->egpio_ulp_pad_receiver_disable(u8GpioNum);
1108 #else
1109 egpio_ulp_pad_receiver_disable(u8GpioNum);
1110 #endif
1111 }
1112
1113 /**
1114 * @fn STATIC INLINE void RSI_EGPIO_UlpPadDriverDisableState(uint8_t u8GpioNum , en_ulp_driver_disable_state_t disablestate)
1115 * @brief This API is used to control the Driver disabled state control
1116 * @param[in] u8GpioNum : GPIO number to be use
1117 * @param[in] disablestate : the value to be passed
1118 * \n possible values are
1119 * \n - 0 for \ref HiZ (P1=0,P2=0)
1120 * \n - 1 for \ref Pullup (P1=0,P2=1)
1121 * \n - 2 for \ref Pulldown (P1=1,P2=0)
1122 * \n - 3 for \ref Repeater (P1=1,P2=1)
1123 * @return None
1124 */
RSI_EGPIO_UlpPadDriverDisableState(uint8_t u8GpioNum,en_ulp_driver_disable_state_t disablestate)1125 STATIC INLINE void RSI_EGPIO_UlpPadDriverDisableState(uint8_t u8GpioNum, en_ulp_driver_disable_state_t disablestate)
1126 {
1127 #if defined(ROMDRIVER_PRESENT)
1128 ROMAPI_EGPIO_API->egpio_ulp_pad_driver_disable_state(u8GpioNum, disablestate);
1129 #else
1130 egpio_ulp_pad_driver_disable_state(u8GpioNum, disablestate);
1131 #endif
1132 }
1133
1134 /**
1135 * @fn STATIC INLINE void RSI_EGPIO_UlpPadDriverStrengthSelect(uint8_t u8GpioNum , en_ulp_driver_strength_select_t strength)
1136 * @brief this API is used to select Drive strength
1137 * @param[in] u8GpioNum : GPIO number to be use
1138 * @param[in] strength : Drive strength selector(E1,E2)
1139 * \n possible values are
1140 * \n - 0 for \ref two_milli_amps (E1=0,E2=0)
1141 * \n - 1 for \ref four_milli_amps (E1=0,E2=1)
1142 * \n - 2 for \ref eight_milli_amps (E1=1,E2=0)
1143 * \n - 3 for \ref twelve_milli_amps(E1=1,E2=1)
1144 * @return None
1145 */
RSI_EGPIO_UlpPadDriverStrengthSelect(uint8_t u8GpioNum,en_ulp_driver_strength_select_t strength)1146 STATIC INLINE void RSI_EGPIO_UlpPadDriverStrengthSelect(uint8_t u8GpioNum, en_ulp_driver_strength_select_t strength)
1147 {
1148 #if defined(ROMDRIVER_PRESENT)
1149 ROMAPI_EGPIO_API->egpio_ulp_pad_driver_strength_select(u8GpioNum, strength);
1150 #else
1151 egpio_ulp_pad_driver_strength_select(u8GpioNum, strength);
1152 #endif
1153 }
1154
1155 /**
1156 * @fn STATIC INLINE void RSI_EGPIO_UlpPadPowerOnStartEnable(uint8_t u8GpioNum ,uint8_t val )
1157 * @brief Power-on-Start enable;
1158 * @param[in] u8GpioNum : GPIO number to be use
1159 * @param[in] val : POS = 1 : Enables active pull down for invalid power;
1160 * \n : POS = 0 : Active pull down capability disabled .
1161 * \n When one of the power supplies is invalid and active high POS is set to 1,
1162 *PAD is pulled to weak 0. When POS is set to 0, PAD remains in a high Z state. : Default 0
1163 * @return None
1164 */
RSI_EGPIO_UlpPadPowerOnStartEnable(uint8_t u8GpioNum,uint8_t val)1165 STATIC INLINE void RSI_EGPIO_UlpPadPowerOnStartEnable(uint8_t u8GpioNum, uint8_t val)
1166 {
1167 #if defined(ROMDRIVER_PRESENT)
1168 ROMAPI_EGPIO_API->egpio_ulp_pad_power_on_start_enable(u8GpioNum, val);
1169 #else
1170 egpio_ulp_pad_power_on_start_enable(u8GpioNum, val);
1171 #endif
1172 }
1173
1174 /**
1175 * @fn STATIC INLINE void RSI_EGPIO_UlpPadActiveHighSchmittTrigger(uint8_t u8GpioNum ,uint8_t val )
1176 * @brief Active high Schmitt trigger (Hysteresis) select;
1177 * @param[in] u8GpioNum : GPIO number to be use
1178 * @param[in] val : SMT=0 : No hysteresis; Default value for reset is 1'b1 and others is 1'b0
1179 * @return None
1180 */
RSI_EGPIO_UlpPadActiveHighSchmittTrigger(uint8_t u8GpioNum,uint8_t val)1181 STATIC INLINE void RSI_EGPIO_UlpPadActiveHighSchmittTrigger(uint8_t u8GpioNum, uint8_t val)
1182 {
1183 #if defined(ROMDRIVER_PRESENT)
1184 ROMAPI_EGPIO_API->egpio_ulp_pad_active_high_schmitt_trigger(u8GpioNum, val);
1185 #else
1186 egpio_ulp_pad_active_high_schmitt_trigger(u8GpioNum, val);
1187 #endif
1188 }
1189
1190 /**
1191 * @fn STATIC INLINE void RSI_EGPIO_UlpPadSlewRateControll(uint8_t u8GpioNum ,uint8_t val )
1192 * @brief Slew Rate Control
1193 * @param[in] u8GpioNum : GPIO number to be use
1194 * @param[in] val : slew rate
1195 * \n - SR = 0 : Slow (half frequency); SR = 1 for Fast , Default 1
1196 * @return None
1197 */
RSI_EGPIO_UlpPadSlewRateControll(uint8_t u8GpioNum,uint8_t val)1198 STATIC INLINE void RSI_EGPIO_UlpPadSlewRateControll(uint8_t u8GpioNum, uint8_t val)
1199 {
1200 #if defined(ROMDRIVER_PRESENT)
1201 ROMAPI_EGPIO_API->egpio_ulp_pad_slew_rate_controll(u8GpioNum, val);
1202 #else
1203 egpio_ulp_pad_slew_rate_controll(u8GpioNum, val);
1204 #endif
1205 }
1206
1207 #ifdef __cplusplus
1208 }
1209 #endif
1210
1211 #endif /*__RSI_ROM_EGPIO_H__*/
1212 /** @} */
1213 /* @}end of RSI_EGPIO_DRIVERS */
1214