You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
toaster-oven-bluepill/Core/Src/app_knob.c

24 lines
354 B

2 years ago
/**
* TODO file description
*/
#include <stdbool.h>
#include "main.h"
#include "app_knob.h"
#include "tim.h"
static struct {
uint16_t wheel;
bool push;
} s_knob = {};
void app_knob_init()
{
/* Enable the rotary encoder */
HAL_TIM_Encoder_Start(&htim4, TIM_CHANNEL_ALL);
}
uint16_t app_knob_get_raw() {
return htim4.Instance->CNT;
}