guowenxue
2022-04-19 edcdb8b7e2b21a4e4ec46f39f13a8601852d5957
mqttd/hal/hal.h
@@ -14,12 +14,36 @@
#ifndef  _HAL_H_
#define  _HAL_H_
#include "lylib/logger.h"
#include <wiringPi.h>
#include "led.h"
#include "lylib/logger.h"
#include "etc/conf.h"
#include "ds18b20.h"
#include "sht20.h"
#include "tsl2561.h"
#include "beep.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_  ----- */