VSF Documented
exti_gpio.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18 #ifndef __HAL_DRIVER_GPIO_EXTI_H__
19 #define __HAL_DRIVER_GPIO_EXTI_H__
20
21 /*============================ INCLUDES ======================================*/
22
23 #include "hal/vsf_hal_cfg.h"
24
25 #if VSF_HAL_USE_GPIO == ENABLED
26
27 #if defined(__VSF_HAL_USE_GPIO_EXTI_CLASS_IMPLEMENT)
28 # undef __VSF_HAL_USE_GPIO_EXTI_CLASS_IMPLEMENT
29 # define __VSF_CLASS_IMPLEMENT__
30 #endif
31
32 #include "utilities/ooc_class.h"
33
34 /*============================ GLOBAL VARIABLES ==============================*/
35 /*============================ MACROS ========================================*/
36
37 #ifndef VSF_EXTI_GPIO_CFG_MULTI_CLASS
38 # define VSF_EXTI_GPIO_CFG_MULTI_CLASS VSF_GPIO_CFG_MULTI_CLASS
39 #endif
40
41 #if VSF_EXTI_GPIO_CFG_MULTI_CLASS == ENABLED
42 # define __describe_exti_gpio_op() .op = &vsf_exti_gpio_op,
43 #else
44 # define __describe_exti_gpio_op()
45 #endif
46
47 #define __describe_gpio_irq_distributor(__name, __gpio, __pin_count, ...) \
48 static vsf_gpio_irq_distributor_irq_t \
49 VSF_MCONNECT(__name, _irqs)[__pin_count]; \
50 vsf_gpio_irq_distributor_t __name = { \
51 .gpio = (vsf_gpio_t *)&__gpio, \
52 .prio = vsf_arch_prio_invalid, \
53 .exti_irq = VSF_MCONNECT(__name, _irqs), \
54 __VA_ARGS__ \
55 };
56
57 #define describe_gpio_irq_distributor(__name, __gpio, ...) \
58 __describe_gpio_irq_distributor(__name, __gpio, __VA_ARGS__)
59
60 #define __describe_exti_gpio(__name, __gpio, __pin_count, ...) \
61 static vsf_gpio_irq_distributor_irq_t \
62 VSF_MCONNECT(__name, _distributor_irqs)[__pin_count]; \
63 vsf_exti_gpio_t __name = { \
64 __describe_exti_gpio_op() \
65 .distributor = { \
66 .gpio = (vsf_gpio_t *)&__gpio, \
67 .prio = vsf_arch_prio_invalid, \
68 .exti_irq = VSF_MCONNECT(__name, _distributor_irqs), \
69 __VA_ARGS__ \
70 }, \
71 };
72
73 #define describe_exti_gpio(__name, __gpio, ...) \
74 __describe_exti_gpio(__name, __gpio, __VA_ARGS__)
75
76 /*============================ MACROFIED FUNCTIONS ===========================*/
77 /*============================ TYPES =========================================*/
78
83
89
91 #if VSF_EXTI_GPIO_CFG_MULTI_CLASS == ENABLED
92 implement(vsf_gpio_t);
93 #endif
95 };
96
97 /*============================ INCLUDES ======================================*/
98
99 #define VSF_GPIO_CFG_DEC_PREFIX vsf_exti
100 #define VSF_GPIO_CFG_DEC_UPCASE_PREFIX vsf_exti
101 #define VSF_GPIO_CFG_DEC_EXTERN_OP ENABLED
103
104 /*============================ PROTOTYPES ====================================*/
105
107 vsf_gpio_exti_irq_cfg_t *irq_cfg_ptr);
108
109 /*============================ IMPLEMENTATION ================================*/
110
111 #endif
112
113 #endif
114 /* EOF */
vsf_err_t
Definition __type.h:42
Definition exti_gpio.h:90
vsf_arch_prio_t
Definition cortex_a_generic.h:88
vsf_err_t vsf_exti_gpio_config_pin(vsf_exti_gpio_t *exti_gpio_ptr, vsf_gpio_pin_mask_t pin_mask, vsf_gpio_exti_irq_cfg_t *irq_cfg_ptr)
Definition exti_gpio.c:104
#define vsf_class(__name)
Definition ooc_class.h:48
Definition vsf_template_gpio.h:597
Definition exti_gpio.h:79
void * target_ptr
Definition exti_gpio.h:81
vsf_gpio_exti_isr_handler_t * handler_fn
Definition exti_gpio.h:80
Definition exti_gpio.h:84
vsf_gpio_t * gpio
Definition exti_gpio.h:85
vsf_arch_prio_t prio
Definition exti_gpio.h:86
vsf_gpio_irq_distributor_irq_t * exti_irq
Definition exti_gpio.h:87
Definition vsf_template_gpio.h:732
void vsf_gpio_exti_isr_handler_t(void *target_ptr, vsf_gpio_t *gpio_ptr, vsf_gpio_pin_mask_t pin_mask)
External interrupt callback function for gpio.
Definition vsf_template_gpio.h:592
uint32_t vsf_gpio_pin_mask_t
Definition vsf_template_gpio.h:308
Generated from commit: vsfteam/vsf@74aa6ce