nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
ext_sensors.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
11#ifndef EXT_SENSORS_H__
12#define EXT_SENSORS_H__
13
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25#define ACCELEROMETER_CHANNELS 3
26
35
46};
47
53 union {
57 double value;
58 };
59};
60
65typedef void (*ext_sensor_handler_t)(
66 const struct ext_sensor_evt *const evt);
67
76
85
93int ext_sensors_humidity_get(double *humid);
94
102int ext_sensors_pressure_get(double *press);
103
118int ext_sensors_air_quality_get(uint16_t *bsec_air_quality);
119
131int ext_sensors_accelerometer_threshold_set(double threshold, bool upper);
132
142
151
152#ifdef __cplusplus
153}
154#endif
158#endif
int ext_sensors_init(ext_sensor_handler_t handler)
Initializes the library, sets callback handler.
int ext_sensors_accelerometer_trigger_callback_set(bool enable)
Enable or disable accelerometer trigger handler.
int ext_sensors_air_quality_get(uint16_t *bsec_air_quality)
Get air quality. Air quality calculations are only available when enabling the Bosch BSEC library.
void(* ext_sensor_handler_t)(const struct ext_sensor_evt *const evt)
External sensors library asynchronous event handler.
Definition: ext_sensors.h:65
int ext_sensors_inactivity_timeout_set(double inact_time)
Set the timeout for the inactivity detection of the accelerometer.
#define ACCELEROMETER_CHANNELS
Definition: ext_sensors.h:25
int ext_sensors_humidity_get(double *humid)
Get humidity from library.
ext_sensor_evt_type
Enum containing callback events from library.
Definition: ext_sensors.h:28
@ EXT_SENSOR_EVT_ACCELEROMETER_ERROR
Definition: ext_sensors.h:37
@ EXT_SENSOR_EVT_ACCELEROMETER_IMPACT_TRIGGER
Definition: ext_sensors.h:34
@ EXT_SENSOR_EVT_ACCELEROMETER_INACT_TRIGGER
Definition: ext_sensors.h:32
@ EXT_SENSOR_EVT_HUMIDITY_ERROR
Definition: ext_sensors.h:41
@ EXT_SENSOR_EVT_ACCELEROMETER_ACT_TRIGGER
Definition: ext_sensors.h:30
@ EXT_SENSOR_EVT_TEMPERATURE_ERROR
Definition: ext_sensors.h:39
@ EXT_SENSOR_EVT_PRESSURE_ERROR
Definition: ext_sensors.h:43
@ EXT_SENSOR_EVT_AIR_QUALITY_ERROR
Definition: ext_sensors.h:45
int ext_sensors_accelerometer_threshold_set(double threshold, bool upper)
Set the threshold that triggers callback on accelerometer data.
int ext_sensors_temperature_get(double *temp)
Get temperature from library.
int ext_sensors_pressure_get(double *press)
Get pressure from library.
double value_array[3]
Definition: ext_sensors.h:55
double value
Definition: ext_sensors.h:57
enum ext_sensor_evt_type type
Definition: ext_sensors.h:51
Structure containing external sensor data.
Definition: ext_sensors.h:49