]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/lights.h
firmware: move PWM_MAX to lights.h
[bike-lights.git] / firmware / lights.h
index c8663492c423646112a6cec26c93658f0912292f..f8223845d0a451c429765922926682df78d8973f 100644 (file)
@@ -28,6 +28,8 @@ void susp_adc();
 void timer_start_adcs();
 
 /* pwm.c */
+#define PWM_MAX 0x1FF
+
 void init_pwm();
 void susp_pwm();
 void pwm_off(unsigned char n);
@@ -57,14 +59,28 @@ extern volatile unsigned char ambient_zone;
 void ambient_adc(uint16_t adc_val);
 
 /* pattern.c */
+typedef struct {
+       unsigned char mode: 3;
+       unsigned char duration: 5;
+} pattern_t;
+
+#define PATTERN_END { 0, 0 }
+extern pattern_t off_pattern[];
+extern pattern_t on_pattern[];
+
 void pattern_init();
 void patterns_next_tick();
 void led_set_status(unsigned char status);
+void led_set_pattern(unsigned char led, pattern_t *pattern);
 
 /* buttons.c */
 void init_buttons();
 void timer_check_buttons();
 
+/* battery.c */
+extern volatile unsigned char battery_100mv;
+void battery_adc();
+
 /* main.c */
 void hw_setup();
 void hw_suspend();