Nucleo-L452RE-P ALTERNATIVE FUNCTIONS Timer Direct Mode - Gpio Output
Hi, I am experimenting with the Nucleo-L452RE-P the ALTERNATIVE FUNCTIONS of the PA6 pin, what I need is that the pin acquires a rising edge through the Timer Direct Mode generating INTERRUPT, this works correctly
void HAL_TIM_IC_CaptureCallback (TIM_HandleTypeDef * htim)
{
if (htim-> Channel == HAL_TIM_ACTIVE_CHANNEL_1)
{
}
}
subsequently it must become a GPIO Output keeping the output low and I do this correctly by configuring the pin in this way:
static GPIO_InitTypeDef GPIO_InitStructA = {0,0,0,0,0};
GPIO_InitStructA.Pin = GPIO_PIN_6;
GPIO_InitStructA.Mode = GPIO_MODE_OUTPUT_OD; // Open drain
GPIO_InitStructA.Pull = GPIO_NOPULL;
GPIO_InitStructA.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init (GPIOA, & GPIO_InitStructA);
HAL_GPIO_WritePin (GPIOA, GPIO_PIN_6, GPIO_PIN_RESET);
Now I just have to find a way to reset the GPIO PA6 as a Timer Direct Mode to wait for a new rising edge, what can I do?