Developer World
Spresense SDK Library v3.3.0-375c679
cxd56_bmp280.h
1/****************************************************************************
2 * boards/arm/cxd56xx/spresense/include/cxd56_bmp280.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
21#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMP280_H
22#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMP280_H
23
24/****************************************************************************
25 * Included Files
26 ****************************************************************************/
27
28#include <nuttx/config.h>
29#include <nuttx/i2c/i2c_master.h>
30
31/****************************************************************************
32 * Public Types
33 ****************************************************************************/
34
35#ifndef __ASSEMBLY__
36
37/****************************************************************************
38 * Public Data
39 ****************************************************************************/
40
41#undef EXTERN
42#if defined(__cplusplus)
43#define EXTERN extern "C"
44extern "C"
45{
46#else
47#define EXTERN extern
48#endif
49
50/****************************************************************************
51 * Public Function Prototypes
52 ****************************************************************************/
53
54/****************************************************************************
55 * Name: board_bmp280_initialize
56 *
57 * Description:
58 * Initialize BMP280 i2c driver and register the BMP280 device.
59 *
60 ****************************************************************************/
61
62#if defined(CONFIG_SENSORS_BMP280) || defined(CONFIG_SENSORS_BMP280_SCU)
63int board_bmp280_initialize(int bus);
64#endif
65
66#ifdef CONFIG_SENSORS_BMP280_SCU
67/****************************************************************************
68 * Name: bmp280_init
69 *
70 * Description:
71 * Initialize BMP280 pressure device
72 *
73 * Input Parameters:
74 * i2c - An instance of the I2C interface to use to communicate with
75 * BMP280
76 * port - I2C port number
77 *
78 * Returned Value:
79 * Zero (OK) on success; a negated errno value on failure.
80 *
81 ****************************************************************************/
82
83int bmp280_init(struct i2c_master_s *i2c, int port);
84
85/****************************************************************************
86 * Name: bmp280press_register
87 *
88 * Description:
89 * Register the BMP280 pressure sensor character device as 'devpath'
90 *
91 * Input Parameters:
92 * devpath - The base path to the driver to register. E.g., "/dev/press0"
93 * minor - The number of sequencer
94 * i2c - An instance of the I2C interface to use to communicate with
95 * BMP280
96 * port - I2C port number
97 *
98 * Returned Value:
99 * Zero (OK) on success; a negated errno value on failure.
100 *
101 ****************************************************************************/
102
103int bmp280press_register(const char *devpath, int minor,
104 struct i2c_master_s *i2c, int port);
105
106/****************************************************************************
107 * Name: bmp280temp_register
108 *
109 * Description:
110 * Register the BMP280 temperature sensor character device as 'devpath'
111 *
112 * Input Parameters:
113 * devpath - The base path to the driver to register. E.g., "/dev/temp"
114 * minor - The number of sequencer
115 * i2c - An instance of the I2C interface to use to communicate with
116 * BMP280
117 * port - I2C port number
118 *
119 * Returned Value:
120 * Zero (OK) on success; a negated errno value on failure.
121 *
122 ****************************************************************************/
123
124int bmp280temp_register(const char *devpath, int minor,
125 struct i2c_master_s *i2c, int port);
126
127#endif
128
129#undef EXTERN
130#if defined(__cplusplus)
131}
132#endif
133
134#endif /* __ASSEMBLY__ */
135#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMP280_H */