2925 |
poskozby |
1 |
/* |
|
|
2 |
* LED.c |
|
|
3 |
* |
|
|
4 |
* Created: 30.11.2011 21:51:11 |
|
|
5 |
* Author: Zbynek |
|
|
6 |
* poskocil@email.cz |
|
|
7 |
* |
|
|
8 |
* Funkce pro praci s LED diodami na modulu |
|
|
9 |
*/ |
|
|
10 |
#include "LED.h" |
|
|
11 |
#include <avr/io.h> |
|
|
12 |
|
|
|
13 |
/************************************************************************ |
|
|
14 |
* Funkce: LEDs_init() |
|
|
15 |
* Ucel: Nastavi PINy, na kterych jsou LED jako vystupy |
|
|
16 |
* Vstup: Zadny |
|
|
17 |
* Vystup: Zadny |
|
|
18 |
************************************************************************/ |
|
|
19 |
volatile void LEDs_init(void) |
|
|
20 |
{ |
|
|
21 |
DDRB = (1<<DDB0)|(1<<DDB1); |
|
|
22 |
} |
|
|
23 |
|
|
|
24 |
/************************************************************************ |
|
|
25 |
* Funkce: LED_horni_on() |
|
|
26 |
* Ucel: Rozsviti LED, ktera je blize pojistce |
|
|
27 |
* Vstup: Zadny |
|
|
28 |
* Vystup: Zadny |
|
|
29 |
************************************************************************/ |
|
|
30 |
volatile void LED_horni_on(void) |
|
|
31 |
{ |
|
|
32 |
PORTB |= (1<<PB0); |
|
|
33 |
} |
|
|
34 |
|
|
|
35 |
/************************************************************************ |
|
|
36 |
* Funkce: LED_horni_off() |
|
|
37 |
* Ucel: Zhasne LED, ktera je blize pojistce |
|
|
38 |
* Vstup: Zadny |
|
|
39 |
* Vystup: Zadny |
|
|
40 |
************************************************************************/ |
|
|
41 |
volatile void LED_horni_off(void) |
|
|
42 |
{ |
|
|
43 |
PORTB &= ~(1<<PB0); |
|
|
44 |
} |
|
|
45 |
|
|
|
46 |
/************************************************************************ |
|
|
47 |
* Funkce: LED_spodni_on() |
|
|
48 |
* Ucel: Rozsviti LED, ktera je dale od pojistky |
|
|
49 |
* Vstup: Zadny |
|
|
50 |
* Vystup: Zadny |
|
|
51 |
************************************************************************/ |
|
|
52 |
volatile void LED_spodni_on(void) |
|
|
53 |
{ |
|
|
54 |
PORTB |= (1<<PB1); |
|
|
55 |
} |
|
|
56 |
|
|
|
57 |
/************************************************************************ |
|
|
58 |
* Funkce: LED_spodni_off() |
|
|
59 |
* Ucel: Zhasne LED, ktera je dale od pojistky |
|
|
60 |
* Vstup: Zadny |
|
|
61 |
* Vystup: Zadny |
|
|
62 |
************************************************************************/ |
|
|
63 |
volatile void LED_spodni_off(void) |
|
|
64 |
{ |
|
|
65 |
PORTB &= ~(1<<PB1); |
|
|
66 |
} |