-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathled.h
More file actions
53 lines (40 loc) · 1.19 KB
/
led.h
File metadata and controls
53 lines (40 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* Ìîðãàíèå ëàìïî÷êàìè */
#ifndef _LED_H
#define _LED_H
#include "globdefs.h"
#include "xpander.h"
/* Ñîñòîÿíèå è ìîðãàíèå ëàìïî÷êàìè */
#define LED_OFF_STATE 0
#define LED_ON_STATE 1
#define LED_SLOW_STATE 2
#define LED_QUICK_STATE 3
/*******************************************************************
* function prototypes
*******************************************************************/
void LED_init(void);
void LED_on(u8);
void LED_off(u8);
void LED_toggle(u8);
#define LED_all_off() do { LED_off(LED1);LED_off(LED2);LED_off(LED3);LED_off(LED4);} while(0)
#if defined GNS110_R2A_BOARD || defined GNS110_R2B_BOARD || defined GNS110_R2C_BOARD
#define LED1 LED4_PIN
#define LED2 LED3_PIN
#define LED3 LED2_PIN
#define LED4 LED1_PIN
#define LEDS_PORT LED1_PORT
#else
/* Ïèíû ÷åðåç 1 ðàâíû - ïîýòîìó òàê */
#define LED1 0
#define LED2 1
#define LED3 2
#define LED4 3
#endif
#define LED_GREEN LED1
#define LED_YELLOW LED2
#define LED_RED LED3
#define LED_BLUE LED4
/* Ëàìïî÷êà îáðàáîò÷èêà ñèãíàëà */
#define LED_SIGNAL LED_YELLOW
/* Ëàìïî÷êà âêëþ÷åíèÿ */
#define LED_POWER LED_RED
#endif /* led.h */