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.
23 lines
354 B
23 lines
354 B
/**
|
|
* 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;
|
|
}
|
|
|