Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
sif_max30205.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Cascoda Ltd.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
36 #ifndef SIF_MAX30205_H
37 #define SIF_MAX30205_H
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /* slave addresses */
44 /* Note that the slave address is hardware progammable by 3 bits (A2,A1,A0)
45  * according to table 1 in the datasheet
46  * SIF_SAD_MAX30205 has to match table 1 (bits 7:1 in address+r/w transfer byte,
47  * not address(6:0)).
48  */
49 #define SIF_SAD_MAX30205 0x90 /* A2/A1/A0 = 0/0/0 */
50 
51 /* master measurement (read access) modes */
53 {
54  SIF_MAX30205_MODE_POLL_ONE_SHOT, /* poll D7 in configuration register */
55  SIF_MAX30205_MODE_TCONV_WAIT, /* wait for maximum conversion time */
56 };
57 
58 /* measurement mode */
59 #define SIF_MAX30205_MODE SIF_MAX30205_MODE_TCONV_WAIT
60 
61 /* max. conversion times for measurement [ms] */
62 #define SIF_MAX30205_TCONV_MAX_TEMP 60 /* temperature */
63 
64 /* configuration register bit mapping */
65 #define SIF_MAX30205_CONFIG_ONESHOT 0x80
66 #define SIF_MAX30205_CONFIG_SHUTDOWN 0x01
67 
68 /* functions */
69 
70 /******************************************************************************/
71 /***************************************************************************/
77 u16_t SIF_MAX30205_ReadTemperature(void); /* measure temperature */
78 
79 /******************************************************************************/
80 /***************************************************************************/
86 u8_t SIF_MAX30205_Initialise(void); /* initialise sensor, shutdown mode */
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
96 #endif // SIF_MAX30205_H
unsigned char u8_t
Definition: cascoda_types.h:46
unsigned short u16_t
Definition: cascoda_types.h:48
u8_t SIF_MAX30205_Initialise(void)
MAX30205: Initialise Sensor.
Definition: sif_max30205.c:202
u16_t SIF_MAX30205_ReadTemperature(void)
MAX30205: Read Temperature.
Definition: sif_max30205.c:116
sif_max30205_mode
Definition: sif_max30205.h:53
@ SIF_MAX30205_MODE_TCONV_WAIT
Definition: sif_max30205.h:55
@ SIF_MAX30205_MODE_POLL_ONE_SHOT
Definition: sif_max30205.h:54