commit | author | age
|
e30a4c
|
1 |
/********************************************************************************* |
GW |
2 |
* Copyright: (C) 2019 LingYun IoT System Studio |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* Filename: hal.h |
|
6 |
* Description: This file is RPi HAL(Hardware Abstract Layer) initial functions |
|
7 |
* |
|
8 |
* Version: 1.0.0(2019年06月24日) |
|
9 |
* Author: Guo Wenxue <guowenxue@gmail.com> |
|
10 |
* ChangeLog: 1, Release initial version on "2019年06月24日 23时46分47秒" |
|
11 |
* |
|
12 |
********************************************************************************/ |
|
13 |
|
|
14 |
#ifndef _HAL_H_ |
|
15 |
#define _HAL_H_ |
|
16 |
|
|
17 |
#include "ds18b20.h" |
|
18 |
#include "sht20.h" |
|
19 |
#include "tsl2561.h" |
|
20 |
#include "gpio.h" |
|
21 |
|
|
22 |
|
|
23 |
typedef struct hal_ctx_s |
|
24 |
{ |
|
25 |
int ds18b20_enable; /* 0:Disable !0: Enable */ |
|
26 |
int sht2x_enable; /* 0:Disable !0: Enable */ |
|
27 |
|
|
28 |
int lux_enable; /* 0:Disable !0: Enable */ |
|
29 |
float lux_threshold; /* Lux Threshold value */ |
|
30 |
|
|
31 |
gpio_t gpio; /* gpio intput/output pins */ |
|
32 |
} hal_ctx_t; |
|
33 |
|
|
34 |
|
|
35 |
/* init hardware */ |
|
36 |
extern int hal_init(hal_ctx_t *ctx); |
|
37 |
|
|
38 |
/* terminal hardware */ |
|
39 |
extern void hal_term(hal_ctx_t *ctx); |
|
40 |
|
|
41 |
#endif /* ----- #ifndef _HAL_H_ ----- */ |
|
42 |
|