root / toolbox / led.h @ 92a430bc
History | View | Annotate | Download (393 Bytes)
1 | 532ba0bd | Tom Mullins | #ifndef LED_H
|
---|---|---|---|
2 | #define LED_H
|
||
3 | |||
4 | #include <avr/io.h> |
||
5 | |||
6 | static inline void led_init() {DDRC |= _BV(DDC1) | _BV(DDC0);} |
||
7 | static inline void led_off() {PORTC &= ~(_BV(PC1) | _BV(PC0));} |
||
8 | static inline void led_red() {PORTC = (PORTC & ~_BV(PC0)) | _BV(PC1);} |
||
9 | static inline void led_yellow() {PORTC |= _BV(PC1) | _BV(PC0);} |
||
10 | static inline void led_green() {PORTC = (PORTC & ~_BV(PC1)) | _BV(PC0);} |
||
11 | |||
12 | #endif |