@@ -71,8 +71,11 @@ void Error_Handler(void);
|
||||
#define run_led2_GPIO_Port GPIOB
|
||||
#define run_led_Pin GPIO_PIN_15
|
||||
#define run_led_GPIO_Port GPIOB
|
||||
#define pwr_en_Pin GPIO_PIN_8
|
||||
#define pwr_en_GPIO_Port GPIOA
|
||||
#define en_c_Pin GPIO_PIN_3
|
||||
#define en_c_GPIO_Port GPIOB
|
||||
#define en_c_EXTI_IRQn EXTI3_IRQn
|
||||
#define en_a_Pin GPIO_PIN_4
|
||||
#define en_a_GPIO_Port GPIOB
|
||||
#define en_a_EXTI_IRQn EXTI4_IRQn
|
||||
|
||||
@@ -57,6 +57,7 @@ void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void EXTI0_IRQHandler(void);
|
||||
void EXTI1_IRQHandler(void);
|
||||
void EXTI3_IRQHandler(void);
|
||||
void EXTI4_IRQHandler(void);
|
||||
void TIM2_IRQHandler(void);
|
||||
void TIM3_IRQHandler(void);
|
||||
|
||||
@@ -310,6 +310,9 @@ static void MX_GPIO_Init(void)
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(run_led_GPIO_Port, run_led_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(pwr_en_GPIO_Port, pwr_en_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin : mute_Pin */
|
||||
GPIO_InitStruct.Pin = mute_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
@@ -317,8 +320,8 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(mute_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : tack_a_Pin tack_b_Pin */
|
||||
GPIO_InitStruct.Pin = tack_a_Pin|tack_b_Pin;
|
||||
/*Configure GPIO pins : tack_a_Pin tack_b_Pin en_c_Pin */
|
||||
GPIO_InitStruct.Pin = tack_a_Pin|tack_b_Pin|en_c_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
@@ -337,11 +340,12 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(run_led_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : en_c_Pin en_b_Pin */
|
||||
GPIO_InitStruct.Pin = en_c_Pin|en_b_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
/*Configure GPIO pin : pwr_en_Pin */
|
||||
GPIO_InitStruct.Pin = pwr_en_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(pwr_en_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : en_a_Pin */
|
||||
GPIO_InitStruct.Pin = en_a_Pin;
|
||||
@@ -349,6 +353,12 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(en_a_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : en_b_Pin */
|
||||
GPIO_InitStruct.Pin = en_b_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(en_b_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
|
||||
@@ -356,6 +366,9 @@ static void MX_GPIO_Init(void)
|
||||
HAL_NVIC_SetPriority(EXTI1_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI1_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI4_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI4_IRQn);
|
||||
|
||||
|
||||
@@ -227,6 +227,20 @@ void EXTI1_IRQHandler(void)
|
||||
/* USER CODE END EXTI1_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line3 interrupt.
|
||||
*/
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI3_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(en_c_Pin);
|
||||
/* USER CODE BEGIN EXTI3_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line4 interrupt.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user