/*********************************************************************************
|
* Copyright: (C) 2019 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: hal.h
|
* Description: This file is RPi HAL(Hardware Abstract Layer) initial functions
|
*
|
* Version: 1.0.0(2019年06月24日)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "2019年06月24日 23时46分47秒"
|
*
|
********************************************************************************/
|
|
#ifndef _HAL_H_
|
#define _HAL_H_
|
|
#include "ds18b20.h"
|
#include "sht20.h"
|
#include "tsl2561.h"
|
#include "gpio.h"
|
|
|
typedef struct hal_ctx_s
|
{
|
int ds18b20_enable; /* 0:Disable !0: Enable */
|
int sht2x_enable; /* 0:Disable !0: Enable */
|
|
int lux_enable; /* 0:Disable !0: Enable */
|
float lux_threshold; /* Lux Threshold value */
|
|
gpio_t gpio; /* gpio intput/output pins */
|
} hal_ctx_t;
|
|
|
/* init hardware */
|
extern int hal_init(hal_ctx_t *ctx);
|
|
/* terminal hardware */
|
extern void hal_term(hal_ctx_t *ctx);
|
|
#endif /* ----- #ifndef _HAL_H_ ----- */
|