/** * @brief Configures LED GPIO. * @param Led: LED to be configured. * This parameter can be one of the following values: * @arg LED2 * @retval None */ void BSP_LED_Init(Led_TypeDef Led) { GPIO_InitTypeDef gpioinitstruct = {0}; /* Enable the GPIO_LED Clock */ LEDx_GPIO_CLK_ENABLE(Led); /* Configure the GPIO_LED pin */ gpioinitstruct.Pin = GPIO_PIN[Led]; gpioinitstruct.Mode = GPIO_MODE_OUTPUT_PP; gpioinitstruct.Pull = GPIO_NOPULL; gpioinitstruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(GPIO_PORT[Led], &gpioinitstruct); }
/** * @brief Configures LED GPIO. * @param Led: LED to be configured. * This parameter can be one of the following values: * @arg LED1 * @arg LED2 * @arg LED3 * @arg LED4 * @retval None */ void BSP_LED_Init(Led_TypeDef Led) { GPIO_InitTypeDef GPIO_InitStruct; /* Enable the GPIO_LED clock */ LEDx_GPIO_CLK_ENABLE(Led); /* Configure the GPIO_LED pin */ GPIO_InitStruct.Pin = GPIO_PIN[Led]; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FAST; HAL_GPIO_Init(GPIO_PORT[Led], &GPIO_InitStruct); }
/** * @brief Configures LED GPIO. * @param Led: Specifies the Led to be configured. * This parameter can be one of following parameters: * @arg LED3 * @retval None */ void BSP_LED_Init(Led_TypeDef Led) { GPIO_InitTypeDef GPIO_InitStruct; /* Enable the GPIO_LED Clock */ LEDx_GPIO_CLK_ENABLE(Led); /* Configure the GPIO_LED pin */ GPIO_InitStruct.Pin = LED_PIN[Led]; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(LED_PORT[Led], &GPIO_InitStruct); HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET); }
/** * @brief Configures LED GPIO. * @param Led: LED to be configured. * This parameter can be one of the following values: * @arg LED2 * @retval None */ void BSP_LED_Init(Led_TypeDef Led) { GPIO_InitTypeDef gpioinitstruct = {0}; /* Enable the GPIO_LED Clock */ LEDx_GPIO_CLK_ENABLE(Led); /* Configure the GPIO_LED pin */ gpioinitstruct.Pin = GPIO_PIN[Led]; gpioinitstruct.Mode = GPIO_MODE_OUTPUT_PP; gpioinitstruct.Pull = GPIO_PULLUP; gpioinitstruct.Speed = GPIO_SPEED_HIGH; HAL_GPIO_Init(GPIO_PORT[Led], &gpioinitstruct); /* Reset PIN to switch off the LED */ HAL_GPIO_WritePin(GPIO_PORT[Led],GPIO_PIN[Led], GPIO_PIN_RESET); }
/** * @brief Configures LED GPIO. * @param Led: Specifies the Led to be configured. * This parameter can be one of following parameters: * @arg LED1 * @arg LED2 * @arg LED3 * @arg LED4 * @retval None */ void BSP_LED_Init(Led_TypeDef Led) { GPIO_InitTypeDef GPIO_InitStructure; /* Enable the GPIO_LED clock */ LEDx_GPIO_CLK_ENABLE(Led); /* Configure the GPIO_LED pin */ GPIO_InitStructure.Pin = LED_PIN[Led]; GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructure.Pull = GPIO_PULLUP; GPIO_InitStructure.Speed = GPIO_SPEED_HIGH; HAL_GPIO_Init(LED_PORT[Led], &GPIO_InitStructure); HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_SET); }