]>
Commit | Line | Data |
---|---|---|
4307b86a | 1 | /* $Id: ledpwm.h,v 1.4 2010/07/25 20:40:44 simimeie Exp $ |
17aea8ef | 2 | * Functions for led brightness control via PWM (pulse width modulation). |
3 | */ | |
4 | ||
5 | #ifndef _LEDPWM_H_ | |
6 | #define _LEDPWM_H_ | |
7 | ||
4307b86a | 8 | #define LEDPWM_REDLED 0 |
9 | #define LEDPWM_GREENLED 1 | |
10 | #define LEDPWM_BLUELED 2 | |
17aea8ef | 11 | |
ddf1553f | 12 | extern uint8_t ledpwm_re; |
13 | extern uint8_t ledpwm_gr; | |
14 | extern uint8_t ledpwm_bl; | |
15 | extern uint8_t ledpwm_bri; | |
16 | ||
4307b86a | 17 | /* Temporary for debugging - these should be internal */ |
18 | extern volatile uint16_t ledpwm_val[3]; | |
19 | extern volatile uint16_t ledpwm_curoreg; | |
20 | ||
17aea8ef | 21 | /* Init PWM (pins and timers) */ |
22 | void ledpwm_init(void); | |
23 | ||
24 | /* Set brightness for a certain LED */ | |
4307b86a | 25 | void ledpwm_setled(uint8_t led, uint16_t val); |
17aea8ef | 26 | |
de0e300b | 27 | /* Set brightness for all LEDs */ |
28 | void ledpwm_set(uint8_t red, uint8_t green, uint8_t blue, uint8_t br); | |
29 | ||
17aea8ef | 30 | #endif /* _LEDPWM_H_ */ |