64f9e34fc3
Complete working firmware including: - CMakeLists.txt for Pico SDK build - SSD1306 OLED driver (128x32, I2C) - High-resolution latency measurement using hardware timer - Debounced button with short/long press detection - Three modes: Single, Continuous, Stats - USB serial debugging output Includes 8x8 font with numbers and letters for display.
33 lines
943 B
C
33 lines
943 B
C
#ifndef CONFIG_H
|
|
#define CONFIG_H
|
|
|
|
// GPIO Pin Assignments (RP2040-Zero)
|
|
#define PIN_I2C_SDA 0 // OLED SDA
|
|
#define PIN_I2C_SCL 1 // OLED SCL
|
|
#define PIN_TRIG_OUT 2 // Trigger output
|
|
#define PIN_RETURN_IN 3 // Return input
|
|
#define PIN_BUTTON 4 // Mode button
|
|
|
|
// I2C Configuration
|
|
#define I2C_PORT i2c0
|
|
#define I2C_FREQ 400000 // 400 kHz
|
|
|
|
// OLED Display (SSD1306 128x32)
|
|
#define OLED_ADDR 0x3C
|
|
#define OLED_WIDTH 128
|
|
#define OLED_HEIGHT 32
|
|
|
|
// Timing Configuration
|
|
#define TRIGGER_PULSE_MS 5 // Trigger pulse width
|
|
#define MEASURE_TIMEOUT_MS 1000 // Max latency measurement
|
|
#define DEBOUNCE_MS 50 // Button debounce
|
|
#define CONTINUOUS_INTERVAL_MS 500 // Interval for continuous mode
|
|
|
|
// Display
|
|
#define DISPLAY_UPDATE_MS 100 // Display refresh rate
|
|
|
|
// Statistics
|
|
#define STATS_SAMPLES 10 // Rolling average sample count
|
|
|
|
#endif // CONFIG_H
|