1 /* 2 * Copyright (c) 2022 Talkweb Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #if defined(USE_FULL_LL_DRIVER) 17 18 #include "hal_gpio.h" 19 #include "stm32f4xx_ll_bus.h" 20 21 #if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || \ 22 defined (GPIOF) || defined (GPIOG) || defined (GPIOH) || defined (GPIOI) || defined (GPIOJ) || defined (GPIOK) 23 LL_GET_GPIOX(STM32_GPIO_GROUP group)24GPIO_TypeDef* LL_GET_GPIOX(STM32_GPIO_GROUP group) 25 { 26 GPIO_TypeDef *GroupAddr = NULL; 27 switch (group) { 28 case STM32_GPIO_GROUP_A: 29 GroupAddr = ((GPIO_TypeDef *)GPIOA); 30 break; 31 case STM32_GPIO_GROUP_B: 32 GroupAddr = ((GPIO_TypeDef *)GPIOB); 33 break; 34 case STM32_GPIO_GROUP_C: 35 GroupAddr = ((GPIO_TypeDef *)GPIOC); 36 break; 37 case STM32_GPIO_GROUP_D: 38 GroupAddr = ((GPIO_TypeDef *)GPIOD); 39 break; 40 case STM32_GPIO_GROUP_E: 41 GroupAddr = ((GPIO_TypeDef *)GPIOE); 42 break; 43 case STM32_GPIO_GROUP_F: 44 GroupAddr = ((GPIO_TypeDef *)GPIOF); 45 break; 46 case STM32_GPIO_GROUP_G: 47 GroupAddr = ((GPIO_TypeDef *)GPIOG); 48 break; 49 case STM32_GPIO_GROUP_H: 50 GroupAddr = ((GPIO_TypeDef *)GPIOH); 51 break; 52 case STM32_GPIO_GROUP_I: 53 GroupAddr = ((GPIO_TypeDef *)GPIOI); 54 break; 55 default: 56 break; 57 } 58 return GroupAddr; 59 } LL_GET_HAL_PIN(STM32_GPIO_PIN pin)60uint32_t LL_GET_HAL_PIN(STM32_GPIO_PIN pin) 61 { 62 return (LL_GPIO_PIN_0 << pin); 63 } 64 65 #endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || \ 66 defined (GPIOF) || defined (GPIOG) || defined (GPIOH) || defined (GPIOI) || defined (GPIOJ) || defined (GPIOK) */ 67 68 #endif /* USE_FULL_LL_DRIVER */ 69