upm
1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
Main Page
Related Pages
UPM Libraries
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
src
veml6070
veml6070.h
Go to the documentation of this file.
1
/*
2
* Author: Abhishek Malik <abhishek.malik@intel.com>
3
* Copyright (c) 2017 Intel Corporation.
4
*
5
* Permission is hereby granted, free of charge, to any person obtaining
6
* a copy of this software and associated documentation files (the
7
* "Software"), to deal in the Software without restriction, including
8
* without limitation the rights to use, copy, modify, merge, publish,
9
* distribute, sublicense, and/or sell copies of the Software, and to
10
* permit persons to whom the Software is furnished to do so, subject to
11
* the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be
14
* included in all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
*/
24
#pragma once
25
26
#include <stdlib.h>
27
#include <unistd.h>
28
#include <stdio.h>
29
#include <string.h>
30
31
#include "upm.h"
32
#include "mraa/i2c.h"
33
34
#ifdef __cplusplus
35
extern
"C"
{
36
#endif
37
38
#define VEML6070_CTRL_REG 0x38 // write only
39
#define VEML6070_SEQ1_DATA_BUF_REG 0x39 // read only
40
#define VEML6070_SEQ2_DATA_BUF_REG 0x38 // read only
41
42
typedef
enum
{
43
HALF_T = 0,
44
ONE_T,
45
TWO_T,
46
FOUR_T } veml6070_integration_time_t;
47
56
typedef
struct
_veml6070_context
{
57
mraa_i2c_context i2c;
58
uint8_t address;
59
uint8_t i2c_bus_number;
60
} *
veml6070_context
;
61
70
veml6070_context
veml6070_init
(uint8_t bus, uint8_t address);
71
77
void
veml6070_close
(
veml6070_context
dev);
78
85
int16_t
veml6070_get_uv_intensity
(
veml6070_context
dev);
86
95
upm_result_t
veml6070_set_integration_time
(
veml6070_context
dev, veml6070_integration_time_t time);
96
97
#ifdef __cplusplus
98
}
99
#endif
veml6070_get_uv_intensity
int16_t veml6070_get_uv_intensity(veml6070_context dev)
Definition:
veml6070.c:69
veml6070_close
void veml6070_close(veml6070_context dev)
Definition:
veml6070.c:65
veml6070_set_integration_time
upm_result_t veml6070_set_integration_time(veml6070_context dev, veml6070_integration_time_t time)
Definition:
veml6070.c:104
_veml6070_context
Definition:
veml6070.h:56
veml6070_init
veml6070_context veml6070_init(uint8_t bus, uint8_t address)
Definition:
veml6070.c:26
Generated on Wed May 24 2017 14:57:05 for upm by
1.8.6