VSF Documented
gpio_template.inc
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/*============================ INCLUDES ======================================*/
19
21
22#if VSF_HAL_USE_GPIO == ENABLED
23
24#define VSF_GPIO_CFG_RETAIN_DEFINED_PREFIX ENABLED
26#undef VSF_GPIO_CFG_RETAIN_DEFINED_PREFIX
27
28#define VSF_IMP_GPIO_EXTI_PORT_MASK VSF_MCONNECT(VSF_GPIO_CFG_IMP_UPCASE_PREFIX, _GPIO_EXTI_PORT_MASK)
29#define VSF_GPIO_EXTI_IMP_PORT_COUNT VSF_MCONNECT(VSF_GPIO_CFG_IMP_UPCASE_PREFIX, _GPIO_EXTI_PORT_COUNT)
30
31#if !defined(VSF_GPIO_EXTI_IMP_MACRO_ONCE) && ((VSF_GPIO_EXTI_IMP_PORT_COUNT > 0) || (VSF_IMP_GPIO_EXTI_PORT_MASK > 0))
32# define VSF_GPIO_CFG_IMP_REMAP_PREFIX vsf_exti
33
34# define VSF_HAL_TEMPLATE_IMP_COUNT_MASK_PREFIX VSF_GPIO_CFG_IMP_UPCASE_PREFIX
35# define VSF_HAL_TEMPLATE_IMP_COUNT_SUFFIX _EXTI_PORT_COUNT
36# define VSF_HAL_TEMPLATE_IMP_MASK_SUFFIX _EXTI_PORT_MASK
37
38# define VSF_GPIO_CFG_IMP_INSTANCE VSF_GPIO_CFG_IMP_PREFIX
39# define VSF_GPIO_CFG_REAL_PREFIX VSF_MCONNECT(VSF_GPIO_CFG_IMP_PREFIX, _exti)
40# define VSF_GPIO_CFG_ORIGIN_PREFIX VSF_MCONNECT(VSF_GPIO_CFG_IMP_PREFIX, _exti)
41# define VSF_HAL_TEMPLATE_IMP_PREFIX VSF_MCONNECT(VSF_GPIO_CFG_IMP_PREFIX, _exti)
42# define VSF_HAL_TEMPLATE_IMP_INSTANCE_PREFIX VSF_MCONNECT(VSF_GPIO_CFG_IMP_PREFIX, _exti)
43# define VSF_HAL_TEMPLATE_IMP_UPCASE_PREFIX VSF_MCONNECT(VSF_GPIO_CFG_IMP_UPCASE_PREFIX, _EXTI)
44
45# define VSF_GPIO_CFG_IMP_LV0(__IDX, __HAL_OP) \
46 describe_exti_gpio( \
47 VSF_MCONNECT(VSF_HAL_TEMPLATE_IMP_PREFIX, _gpio, __IDX), \
48 VSF_MCONNECT(VSF_GPIO_CFG_IMP_INSTANCE, _gpio, __IDX), \
49 VSF_MCONNECT(VSF_GPIO_CFG_IMP_UPCASE_PREFIX, _GPIO_PIN_COUNT), \
50 __HAL_OP \
51 )
53# undef VSF_GPIO_CFG_RETAIN_DEFINED_PREFIX
54
55# undef VSF_IMP_GPIO_EXTI_PORT_MASK
56# undef VSF_GPIO_EXTI_IMP_PORT_COUNT
57# define VSF_GPIO_EXTI_IMP_MACRO_ONCE
58#else
59# undef VSF_GPIO_CFG_IMP_PREFIX
60# undef VSF_GPIO_CFG_IMP_UPCASE_PREFIX
61#endif
62
63#endif /* VSF_HAL_USE_GPIO */