Initial commit: Phase 1 skeleton
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// hal/switch_stub.h
|
||||
#pragma once
|
||||
|
||||
class SwitchStub {
|
||||
public:
|
||||
virtual ~SwitchStub() {}
|
||||
|
||||
virtual void begin() = 0;
|
||||
virtual bool is_pressed(uint8_t switch_id) = 0;
|
||||
|
||||
// Configuration methods
|
||||
virtual void configure_switch(uint8_t switch_id, uint8_t gpio_pin) = 0;
|
||||
virtual void set_debounce_time(uint32_t time_ms) = 0;
|
||||
};
|
||||
|
||||
// Switch state structure
|
||||
struct SwitchState {
|
||||
uint8_t id; // Switch identifier
|
||||
uint8_t gpio_pin; // GPIO pin (if applicable)
|
||||
bool current_state; // Current pressed state
|
||||
bool previous_state; // Previous state (for debounce)
|
||||
uint32_t last_change_time; // Timestamp of last state change
|
||||
uint32_t debounce_time; // Debounce time in ms
|
||||
};
|
||||
Reference in New Issue
Block a user