/*********************************************************************************
|
* Copyright: (C) 2018 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: led.h
|
* Description: This file is used to control RGB 3-colours LED
|
*
|
* pi@raspberrypi:~ $ gpio readall show BCM and wPi pinmap
|
*
|
* LED BCM wPi #PIN
|
* G ---- GPIO.13 ---- GPIO.23 ---- 33
|
* R ---- GPIO.19 ---- GPIO.24 ---- 35
|
* B ---- GPIO.26 ---- GPIO.25 ---- 37
|
* I ---- GND ----
|
*
|
* Version: 1.0.0(2018/10/14)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "2018/10/14 12:13:26"
|
*
|
********************************************************************************/
|
|
#ifndef __LED_H
|
#define __LED_H
|
|
#define OFF 0
|
#define ON 1
|
|
/* Three LEDs code */
|
enum
|
{
|
LED_R = 0,
|
LED_G,
|
LED_B,
|
LED_MAX,
|
};
|
|
/* 3 LEDs WiringPi GPIO port */
|
|
/* LED_R LED_G LED_B */
|
static int led_gpio[LED_MAX]= { 24, 23, 25 };
|
|
|
void init_led(void);
|
int turn_led(int which, int cmd);
|
|
|
#endif
|