msba2-common/drivers/include/sht11-board.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #ifndef SHT11_BOARD_H
10 #define SHT11_BOARD_H
11 
27 #include "cpu.h"
28 #include "board.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /* serial clock line low */
35 #define SHT11_SCK_LOW FIO1CLR = BIT25;
36 /* serial clock line high */
37 #define SHT11_SCK_HIGH FIO1SET = BIT25;
38 /* read serial I/O */
39 #define SHT11_DATA ((FIO1PIN & BIT26) != 0)
40 /* serial I/O line low */
41 #define SHT11_DATA_LOW (FIO1CLR = BIT26);
42 /* serial I/O line high */
43 #define SHT11_DATA_HIGH (FIO1SET = BIT26);
44 /* serial I/O as input */
45 #define SHT11_DATA_IN (FIO1DIR &= ~BIT26)
46 /* serial I/O as output */
47 #define SHT11_DATA_OUT (FIO1DIR |= BIT26)
48 
49 #define SHT11_INIT FIO1DIR |= BIT25; PINSEL3 &= ~(BIT14|BIT15 | BIT16|BIT17);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
56 #endif /* SHT11_BOARD_H */