--- /dev/null
+#include <avr/io.h>
+
+#include "lights.h"
+
+void gpio_init()
+{
+ DDRB |= _BV(PB2) | _BV(PB4);
+ PORTB &=~ (_BV(PB2) | _BV(PB4));
+}
+
+void gpio_set(unsigned char n, unsigned char on)
+{
+ unsigned char bits = 0;
+ switch(n) {
+ case GPIO_LED1: bits = _BV(PB4); break;
+ case GPIO_LED2: bits = _BV(PB2); break;
+ }
+
+ if (on) {
+ PORTB |= bits;
+ } else {
+ PORTB &= ~bits;
+ }
+}
+
void pwmled_set_mode(unsigned char n, unsigned char mode);
unsigned char pwmled_is_on(unsigned char n);
+/* gpio.c */
+#define GPIO_LED1 0
+#define GPIO_LED2 1
+
+void gpio_init();
+void gpio_set(unsigned char n, unsigned char on);
#endif /* !LIGHTS_H__ */