Add firmware skeleton for RP2040

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.
This commit is contained in:
2026-01-23 03:33:35 +01:00
parent f100eb23bf
commit 64f9e34fc3
11 changed files with 889 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef BUTTON_H
#define BUTTON_H
#include <stdbool.h>
#include <stdint.h>
typedef enum {
BTN_NONE,
BTN_SHORT_PRESS, // < 500ms
BTN_LONG_PRESS // >= 500ms
} button_event_t;
// Initialize button GPIO
void button_init(void);
// Poll button state (call in main loop)
// Returns event type when button is released
button_event_t button_poll(void);
// Check if button is currently pressed
bool button_is_pressed(void);
#endif // BUTTON_H