-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInput.h
More file actions
33 lines (25 loc) · 926 Bytes
/
Copy pathInput.h
File metadata and controls
33 lines (25 loc) · 926 Bytes
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
/**
* @file Input.h
* @brief Header file for the Rotary Encoder input module.
* * Defines the external variables and function prototypes required
* to handle physical user interactions via the rotary encoder.
*/
#ifndef INPUT_H
#define INPUT_H
// --- External Global Variables ---
/** * @brief Relative steps rotated since the last cycle.
* Positive values indicate clockwise rotation, negative values counter-clockwise.
*/
extern int encoderDelta;
/** * @brief State flag indicating if the encoder button was clicked during the current loop.
*/
extern bool buttonPressed;
// --- Function Prototypes ---
/** * @brief Configures GPIO pins with pull-ups and initializes the encoder hardware interrupts.
*/
void initInput();
/** * @brief Polls the encoder, calculates the rotation delta, and checks for button clicks.
* Must be called continuously in the main loop().
*/
void updateInput();
#endif // INPUT_H