6 #define N_PWMLED_MODES 4
12 void log_set_state(unsigned char val);
15 void log_byte(unsigned char byte);
16 void log_word(uint16_t word);
18 void inline log_set_state(unsigned char val) { }
19 void inline log_init() { }
20 void inline log_flush() { }
21 void inline log_byte(unsigned char byte) { }
22 void inline log_word(uint16_t word) { }
28 void timer_start_adcs();
31 #define PWM_MAX 0x1E4 /* This should be different than ADC frequency 125 kHz */
32 #define PWM_STEP_SHIFT 2 /* second parameter of pwm_set is shifted by
33 * PWM_STEP_SHIFT bits to the right before setting
38 void pwm_off(unsigned char n);
39 void pwm_set(unsigned char n, uint16_t stride);
43 extern volatile uint16_t jiffies;
49 void pwmled_adc(unsigned char n, uint16_t adcval);
50 void pwmled_set_mode(unsigned char n, unsigned char mode);
55 void gpio_set(unsigned char n, unsigned char on);
56 void gpio_before_poweroff();
60 extern volatile unsigned char ambient_zone;
61 void ambient_adc(uint16_t adc_val);
65 unsigned char mode: 3;
66 unsigned char duration: 5;
69 #define PATTERN_FOREVER 0x1F
70 #define PATTERN_END { 0, 0 }
71 extern pattern_t off_pattern[];
72 extern pattern_t zero_pattern[];
73 extern pattern_t on_pattern[];
74 extern pattern_t mode1_pattern[];
77 void patterns_next_tick();
78 void led_set_pattern(unsigned char led, pattern_t *pattern);
79 pattern_t *number_pattern(unsigned char num);
82 #define MAX_USER_PARAMS 3
85 void timer_check_buttons();
86 unsigned char get_user_param(unsigned char param);
87 pattern_t *status_pattern_select(unsigned char n);
88 unsigned char buttons_wait_for_release();
91 extern volatile unsigned char battery_100mv;
98 #endif /* !LIGHTS_H__ */