OneWay  3.0-3-ge9d4fa4
led.h
1 /* This file is part of OneWay
2  * Copyright (C) 2010, 2011 Enrico Rossi
3  *
4  * OneWay is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * OneWay is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /* Doxygen undocumented */
19 
20 #ifndef LED_H
21 #define LED_H
22 
23 #include <stdint.h>
24 #include <avr/io.h>
25 
27 #define LED_PORT PORTB
28 
29 #define LED_DDR DDRB
30 
31 #define LED_RED PB2
32 
33 #define LED_GREEN PB3
34 
35 #define LED_DELAY _delay_ms(200)
36 
38 #define OFF 0
39 #define ON 1
40 #define BLINK 2
41 
43 #define NONE 0
44 #define RED 1
45 #define GREEN 2
46 #define BOTH 3
47 
48 void led_set(const uint8_t led, const uint8_t status);
49 void led_init(void);
50 
51 #endif
void led_set(const uint8_t led, const uint8_t status)
turn on, off and blink a led or both.
Definition: led.c:29
void led_init(void)
initialize the port and turn both led on.
Definition: led.c:75