board.h 909 B

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