upm
1.1.0
Sensor/Actuator repository for libmraa (v1.5.1)
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
abpdrrt005pg2a5
abpdrrt005pg2a5.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 ABPDRRT005PG2A5_ADDRESS 0x28
39
#define OUTPUT_10_PERCENT_COUNT 1638
40
#define OUTPUT_90_PERCENT_COUNT 14746
41
#define ABPDRRT005PG2A5_PRESSURE_MAX 5
42
#define ABPDRRT005PG2A5_PRESSURE_MIN 0
43
52
typedef
struct
_abpdrrt005pg2a5_context
{
53
mraa_i2c_context i2c;
54
uint8_t i2c_bus_number;
55
uint8_t address;
56
} *
abpdrrt005pg2a5_context
;
57
64
abpdrrt005pg2a5_context
abpdrrt005pg2a5_init
(uint8_t bus, uint8_t dev_address);
65
71
void
abpdrrt005pg2a5_close
(
abpdrrt005pg2a5_context
dev);
72
80
upm_result_t
abpdrrt005pg2a5_get_pressure_psi
(
abpdrrt005pg2a5_context
dev,
float
* pressure_psi);
81
88
upm_result_t
abpdrrt005pg2a5_get_pressure_pascal
(
abpdrrt005pg2a5_context
dev,
float
* pressure_pascal);
89
90
#ifdef __cplusplus
91
}
92
#endif
abpdrrt005pg2a5_get_pressure_psi
upm_result_t abpdrrt005pg2a5_get_pressure_psi(abpdrrt005pg2a5_context dev, float *pressure_psi)
Definition:
abpdrrt005pg2a5.c:66
abpdrrt005pg2a5_get_pressure_pascal
upm_result_t abpdrrt005pg2a5_get_pressure_pascal(abpdrrt005pg2a5_context dev, float *pressure_pascal)
Definition:
abpdrrt005pg2a5.c:91
abpdrrt005pg2a5_close
void abpdrrt005pg2a5_close(abpdrrt005pg2a5_context dev)
Definition:
abpdrrt005pg2a5.c:62
abpdrrt005pg2a5_init
abpdrrt005pg2a5_context abpdrrt005pg2a5_init(uint8_t bus, uint8_t dev_address)
Definition:
abpdrrt005pg2a5.c:26
_abpdrrt005pg2a5_context
Definition:
abpdrrt005pg2a5.h:52
Generated on Wed Mar 29 2017 21:46:43 for upm by
1.8.6