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#define vsf_gpio_exti_irq_pin_config(__GPIO, ...) \
42 vsf_exti_gpio_exti_irq_pin_config((vsf_exti_gpio_t *)(__GPIO), ##__VA_ARGS__)
43
44
45#if VSF_EXTI_GPIO_CFG_MULTI_CLASS == ENABLED
46# define __describe_exti_gpio_op() .vsf_gpio.op = &vsf_exti_gpio_op,
47#else
48# define __describe_exti_gpio_op()
49#endif
50
51#define __describe_exti_gpio(__name, __gpio, __pin_count, ...) \
52 static vsf_exti_gpio_irq_t VSF_MCONNECT(__name, _irqs)[__pin_count]; \
53 vsf_exti_gpio_t __name = { \
54 __describe_exti_gpio_op() \
55 .gpio = (vsf_gpio_t *)&__gpio, \
56 .prio = vsf_arch_prio_invalid, \
57 .exti_irq = VSF_MCONNECT(__name, _irqs), \
58 __VA_ARGS__ \
59 };
60
61#define describe_exti_gpio(__name, __gpio, ...) \
62 __describe_exti_gpio(__name, __gpio, __VA_ARGS__)
63
64
65/*============================ MACROFIED FUNCTIONS ===========================*/
66/*============================ TYPES =========================================*/
67
68typedef struct vsf_exti_gpio_irq_t {
72
73typedef struct vsf_exti_gpio_t {
74#if VSF_EXTI_GPIO_CFG_MULTI_CLASS == ENABLED
76#endif
81
82/*============================ INCLUDES ======================================*/
83
84#define VSF_GPIO_CFG_DEC_PREFIX vsf_exti
85#define VSF_GPIO_CFG_DEC_UPCASE_PREFIX vsf_exti
86#define VSF_GPIO_CFG_DEC_EXTERN_OP ENABLED
88
89/*============================ PROTOTYPES ====================================*/
90
92 vsf_exti_gpio_t *hw_exti_gpio_ptr, vsf_gpio_pin_mask_t pin_mask,
93 vsf_gpio_exti_irq_cfg_t *irq_cfg_ptr);
94
95/*============================ IMPLEMENTATION ================================*/
96
97#endif
98
99#endif
100/* EOF */
vsf_err_t
Definition __type.h:42
vsf_arch_prio_t
Definition cortex_a_generic.h:88
vsf_err_t vsf_exti_gpio_exti_irq_pin_config(vsf_exti_gpio_t *hw_exti_gpio_ptr, vsf_gpio_pin_mask_t pin_mask, vsf_gpio_exti_irq_cfg_t *irq_cfg_ptr)
Definition exti_gpio.c:159
Definition exti_gpio.h:68
void * target_ptr
Definition exti_gpio.h:70
vsf_gpio_exti_isr_handler_t * handler_fn
Definition exti_gpio.h:69
Definition exti_gpio.h:73
vsf_gpio_t * gpio
Definition exti_gpio.h:77
vsf_exti_gpio_irq_t * exti_irq
Definition exti_gpio.h:79
vsf_arch_prio_t prio
Definition exti_gpio.h:78
vsf_gpio_t vsf_gpio
Definition exti_gpio.h:75
Definition vsf_template_gpio.h:407
Definition vsf_template_gpio.h:491
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:402
#define vsf_gpio_pin_mask_t
Definition vsf_template_gpio.h:207