From 55f465be474c54edbceb3c6013ae629e0e0323d8 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 31 Jul 2019 16:26:46 +0800
Subject: [PATCH] Add tsl2561 code, and test force fill-in light ok

---
 mqttd/hal/hal.h |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/mqttd/hal/hal.h b/mqttd/hal/hal.h
index 7855cdd..37e1510 100644
--- a/mqttd/hal/hal.h
+++ b/mqttd/hal/hal.h
@@ -17,12 +17,32 @@
 #include <wiringPi.h>
 
 #include "lylib/logger.h"
+#include "etc/conf.h"
 
-#include "led.h"
-#include "relay.h"
 #include "ds18b20.h"
 #include "sht20.h"
+#include "tsl2561.h"
 
-int hal_init(void);
+#define OFF   0
+#define ON    1
+
+/* Three LEDs code */
+enum
+{
+	LED_R = 0,
+	LED_G,
+	LED_B,
+	LED_MAX,
+};
+
+extern int hal_init(hwconf_t *conf);
+extern void turn_relay(int cmd);
+extern int turn_led(int which, int cmd);
+extern void init_infrared(int pin);
+extern void turn_beep(int times);
+
+/*  jitter_time: cancel jitter interval time 
+ * Return value: 1(HIGH): Sombody detected  0(LOW): Nobody detected */
+extern int infrared_detect(int jitter_time);
 
 #endif   /* ----- #ifndef _HAL_H_  ----- */

--
Gitblit v1.9.1