-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbacklight.h
More file actions
22 lines (16 loc) · 786 Bytes
/
Copy pathbacklight.h
File metadata and controls
22 lines (16 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// backlight.h — Display illumination control (PB2 active-low driver).
//
// PB2 is DC-driven, not wired to any hardware PWM channel (Timer1 is
// reserved exclusively for audio, and Timer2's PWM pins are PB3/PD3, not
// PB2). Brightness control below is therefore a small software PWM,
// serviced from the main loop -- non-blocking, no hardware timer needed.
#ifndef BACKLIGHT_H
#define BACKLIGHT_H
#include <stdint.h>
void backlightInit(void);
// 0-100 (%). Takes effect gradually as backlightUpdate() services the
// software PWM cycle; doesn't switch the pin immediately.
void backlightSetBrightness(uint8_t percent);
// Call once per main loop iteration with the current systemGetTimeMs().
void backlightUpdate(uint32_t nowMs);
#endif // BACKLIGHT_H