123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #ifndef _BOARD_H
- #define _BOARD_H
- /* Includes */
- #include "main.h"
- #include "gpio.h"
- /* Type Defs */
- /* Exported macros */
- /* Constants */
- #define USE_SERVO_1 true
- //#define USE_SERVO_2 true
- /* PWM Timers for 50 Hz */
- #define TIM1_PSC (24 - 1)
- #define TIM1_ARR (20000 - 1)
- #define SERVO_INIT_VAL 0
- #define SERVO_OPEN_VAL 1000
- #define SERVO_CLOSE_VAL 2000
- #define TIM3_PSC (24000 - 1)
- #define TIM3_ARR (100 - 1)
- /* Defines */
- #define Select_Pin GPIO_PIN_3
- #define Select_Port GPIOA
- #define Photo_Pin GPIO_PIN_7
- #define Photo_Port GPIOB
- #ifdef USE_SERVO_1
- #define Servo_1_Pin GPIO_PIN_3
- #define Servo_1_Port GPIOB
- #define Servo_1_CHNL TIM1->CCR2
- #endif
- #ifdef USE_SERVO_2
- #define Servo_2_Pin GPIO_PIN_8
- #define Servo_2_Port GPIOA
- #define Servo_2_CHNL TIM1->CCR1
- #define Servo_2_ON {}
- #endif
- /* Variables */
- /* Exported funcions */
- void SystemClock_Config(void);
- void Board_Init(void);
- void delay_ms(uint32_t msek);
- void SysTick_Handler(void);
- #endif /* _BPARD_H */
|