test in progress

This commit is contained in:
Sheikah
2023-01-19 00:11:51 +08:00
commit b5cdb2d335
1163 changed files with 636480 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#include "RotaryCoder.h"
uint16_t COUNT;
uint16_t DIR;
uint8_t EC11_init(void)
{
COUNT = 0;
DIR = 0;
HAL_TIM_Encoder_Start(&htim3, TIM_CHANNEL_ALL);
// HAL_TIM_Encoder_Start_IT(&htim3,TIM_CHANNEL_ALL);
return 1;
}
uint16_t EC11_DIR(void)
{
DIR = __HAL_TIM_IS_TIM_COUNTING_DOWN(&htim3);
// STATUS.DATA.COUNT = __HAL_TIM_GET_COUNTER(&htim3);
return DIR;
}
uint16_t EC11_COUNT(void)
{
COUNT = __HAL_TIM_GET_COUNTER(&htim3);
return COUNT;
}

View File

@ -0,0 +1,13 @@
// Rotary encoder library for Arduino.
#include "main.h"
#include "tim.h"
#ifndef rotary_h
#define rotary_h
uint8_t
EC11_init(void);
// Process pin(s)
uint16_t EC11_DIR(void);
uint16_t EC11_COUNT(void);
#endif