board.h 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #ifndef _BOARD_H
  3. #define _BOARD_H
  4. /* Includes */
  5. #include "main.h"
  6. #include "gpio.h"
  7. //#include "xprintf.h"
  8. /* Type Defs */
  9. /* Exported macros */
  10. /* Constants */
  11. /* PWM Timers for 50 Hz */
  12. #define TIM1_PSC (24 - 1)
  13. #define TIM1_ARR (20000 - 1)
  14. #define SERVO_INIT_VAL 1000
  15. #define SERVO_OPEN_VAL 2000
  16. #define TIM3_PSC (24000 - 1)
  17. #define TIM3_ARR (100 - 1)
  18. /* Defines */
  19. #define Select_Pin GPIO_PIN_3
  20. #define Select_Port GPIOA
  21. #define Photo_Pin GPIO_PIN_7
  22. #define Photo_Port GPIOB
  23. #define Servo_1_Pin GPIO_PIN_8
  24. #define Servo_1_Port GPIOA
  25. #define Servo_2_Pin GPIO_PIN_3
  26. #define Servo_2_Port GPIOB
  27. #define Servo_1_CHNL TIM1->CCR1
  28. #define Servo_2_CHNL TIM1->CCR2
  29. /* Variables */
  30. /* Exported funcions */
  31. void SystemClock_Config(void);
  32. void Board_Init(void);
  33. void delay_ms(uint32_t msek);
  34. void SysTick_Handler(void);
  35. #endif /* _BPARD_H */