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.
34 lines
942 B
34 lines
942 B
#pragma once
|
|
#include "main.h"
|
|
#include <stdbool.h>
|
|
|
|
typedef enum
|
|
{
|
|
CAMERA_ENCODER = 0X00,
|
|
DRIVEN_ENCODER_GEAR = 0X01,
|
|
ENCODER_NUMBER,
|
|
} encoder_usage_t;
|
|
|
|
typedef enum
|
|
{
|
|
STANDBY = 0X00,
|
|
WORKING = 0X01,
|
|
ENCODER_STATE_NUMBER_AND_ERR_STATE,
|
|
} encoder_light_state_t;
|
|
|
|
typedef struct
|
|
{
|
|
TIM_HandleTypeDef *tim_handler;
|
|
uint32_t tim_channel;
|
|
} encoder_t;
|
|
|
|
void encoder_all_start(void);
|
|
void encoder_all_stop(void);
|
|
bool encoder_clear_counter(encoder_usage_t encoder);
|
|
void encoder_all_clear_counter(void);
|
|
bool encoder_read_with_encoder(encoder_usage_t encoder, uint32_t *encoder_value);
|
|
void encoder_light_schedule(void);
|
|
void encoder_set_state(encoder_usage_t encoder, encoder_light_state_t state);
|
|
encoder_light_state_t encoder_get_state(encoder_usage_t encoder);
|
|
void encoder_all_encoder_clear_counter_and_structer_count(void);
|
|
void encoder_switch_encoder_clear_count_and_structer_count(encoder_usage_t encoder);
|