-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem_config.h
More file actions
35 lines (25 loc) · 1.3 KB
/
system_config.h
File metadata and controls
35 lines (25 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SYSTEM_CONFIG_H
#define SYSTEM_CONFIG_H
#include <stdint.h>
// System configuration constants
#define SYSTEM_CLOCK_FREQ_HZ 100000000 // 100 MHz (typical Basys3 clock)
#define MOTOR_PWM_FREQ_HZ 1000 // 1 kHz PWM frequency
#define SENSOR_DEBOUNCE_TIME_MS 10 // 10ms debounce time
#define CALIBRATION_FACTOR 10.0f // Steps per millimeter (adjustable)
// Motor control constants
#define MOTOR_STEP_SIZE 1 // Steps per motor update
#define MOTOR_HOME_POSITION 0 // Home position in steps
#define PLATFORM_LENGTH_STEPS 10000 // Maximum platform length in steps
// Sensor pin definitions (for hardware abstraction)
#define SENSOR_PIN 0 // GPIO pin for sensor input
// Motor control pins
#define MOTOR_DIR_PIN 1 // GPIO pin for motor direction
#define MOTOR_PWM_PIN 2 // GPIO pin for motor PWM
// Display pins
#define LED_INDICATOR_PIN 3 // GPIO pin for LED indicator
#define DISPLAY_SEGMENT_PINS 4 // Starting pin for display segments
// Timing constants
#define UPDATE_INTERVAL_MS 1 // Main loop update interval
// Conversion factors
#define MS_TO_CLOCK_CYCLES(ms) ((ms) * (SYSTEM_CLOCK_FREQ_HZ / 1000))
#endif // SYSTEM_CONFIG_H