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.

21 lines
472 B

2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include "main.h"
  3. #include <stdbool.h>
  4. typedef enum
  5. {
  6. CAMERA_ENCODER = 0X00,
  7. DRIVEN_ENCODER_GEAR = 0X01,
  8. } encoder_usage_t;
  9. typedef struct
  10. {
  11. TIM_HandleTypeDef *tim_handler;
  12. uint32_t tim_channel;
  13. } encoder_t;
  14. void encoder_all_start(void);
  15. void encoder_all_stop(void);
  16. bool encoder_clear_counter(encoder_usage_t encoder);
  17. void encoder_all_clear_counter(void);
  18. bool encoder_read_with_encoder(encoder_usage_t encoder, uint32_t *encoder_value);