board.h 888 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #define LED_ON() GPIO_PIN_SET(GPIOB, GPIO_PIN_0)
  10. #define LED_OFF() GPIO_PIN_RES(GPIOB, GPIO_PIN_0)
  11. /* Constants */
  12. /* PWM Timers for 50 Hz */
  13. #define TIM1_PSC (24 - 1)
  14. #define TIM1_ARR (20000 - 1)
  15. #define SERVO_INIT_VAL 1000
  16. #define SERVO_OPEN_VAL 2000
  17. #define TIM3_PSC (24000 - 1)
  18. #define TIM3_ARR (100 - 1)
  19. /* Defines */
  20. #define Photo_Pin GPIO_PIN_7
  21. #define Photo_Port GPIOB
  22. #define Servo_2_Pin GPIO_PIN_8
  23. #define Servo_2_Port GPIOA
  24. #define Servo_1_Pin GPIO_PIN_11
  25. #define Servo_1_Port GPIOA
  26. /* Variables */
  27. /* Exported funcions */
  28. void SystemClock_Config(void);
  29. void Board_Init(void);
  30. void delay_ms(uint32_t msek);
  31. void SysTick_Handler(void);
  32. #endif /* _BPARD_H */