add encoder config
This commit is contained in:
parent
6ded190d3d
commit
cdcf3a2f9d
1 changed files with 13 additions and 6 deletions
19
Src/Sail.c
19
Src/Sail.c
|
@ -1,14 +1,20 @@
|
|||
#include "Sail.h"
|
||||
#include "ServoMotor.h"
|
||||
#include "IncrementalEncoder.h"
|
||||
|
||||
TIM_TypeDef * SAIL_TIMER = TIM4;
|
||||
const int SAIL_CHANNEL = LL_TIM_CHANNEL_CH3;
|
||||
GPIO_TypeDef * SAIL_GPIO = GPIOB;
|
||||
const int SAIL_PIN = LL_GPIO_PIN_8;
|
||||
TIM_TypeDef * MOTOR_TIMER = TIM4;
|
||||
const int MOTOR_CHANNEL = LL_TIM_CHANNEL_CH3;
|
||||
GPIO_TypeDef * MOTOR_GPIO = GPIOB;
|
||||
const int MOTOR_PIN = LL_GPIO_PIN_8;
|
||||
|
||||
TIM_TypeDef * ENCODER_TIMER = TIM3;
|
||||
GPIO_TypeDef * ENCODER_GPIO = GPIOA;
|
||||
const int ENCODER_PIN = LL_GPIO_PIN_5;
|
||||
|
||||
void Sail_conf()
|
||||
{
|
||||
ServoMotor_conf(SAIL_TIMER, SAIL_CHANNEL, SAIL_GPIO, SAIL_PIN);
|
||||
ServoMotor_conf(MOTOR_TIMER, MOTOR_CHANNEL, MOTOR_GPIO, MOTOR_PIN);
|
||||
IncrementalEncoder_conf(ENCODER_TIMER, ENCODER_GPIO, ENCODER_PIN);
|
||||
}
|
||||
|
||||
void Sail_background()
|
||||
|
@ -24,5 +30,6 @@ void Sail_reset()
|
|||
|
||||
void Sail_start()
|
||||
{
|
||||
Timer_start(SAIL_TIMER);
|
||||
Timer_start(MOTOR_TIMER);
|
||||
Timer_start(ENCODER_TIMER);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue