board.h 780 B

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