-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/auto_init: Updated sht1x auto_init #11872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| FEATURES_REQUIRED += periph_gpio | ||
| USEMODULE += xtimer | ||
| ifneq (,$(filter auto_init_sensors_actuators_default,$(USEMODULE))) | ||
| USEMODULE += auto_init_actuators_sensors_sht1x | ||
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /* | ||
|
maribu marked this conversation as resolved.
|
||
| * Copyright 2019 Otto-von-Guericke-Universität Magdeburg | ||
| * | ||
| * This file is subject to the terms and conditions of the GNU Lesser | ||
| * General Public License v2.1. See the file LICENSE in the top level | ||
| * directory for more details. | ||
| */ | ||
|
|
||
| /** | ||
| * @ingroup drivers_sht1x | ||
| * | ||
| * @{ | ||
| * @file | ||
| * @brief Data types of SHT10/SHT11/SHT15 Device Driver | ||
| * | ||
| * @author Marian Buschsieweke <marian.buschsieweke@ovgu.de> | ||
| */ | ||
|
|
||
| #ifndef SHT1X_TYPES_H | ||
| #define SHT1X_TYPES_H | ||
|
|
||
| #include <stdint.h> | ||
| #include <periph/gpio.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief Possible configuration (=status byte) values of the SHT10/11/15 | ||
| * | ||
| * These values can be or'ed together to get the configuration. | ||
| */ | ||
| typedef enum { | ||
| /** Use 8/12 bit resolution instead of 12/14 bit for temp/hum */ | ||
| SHT1X_CONF_LOW_RESOLUTION = 0x01, | ||
| /** Don't upload calibration data to register to safe 10 millisec */ | ||
| SHT1X_CONF_SKIP_CALIBRATION = 0x02, | ||
| /** Waste 8mA at 5V to increase the sensor temperature up to 10°C */ | ||
| SHT1X_CONF_ENABLE_HEATER = 0x04, | ||
| /** Skip the CRC check (and reading the CRC byte) to safe time */ | ||
| SHT1X_CONF_SKIP_CRC = 0x08, | ||
| } sht1x_conf_t; | ||
|
|
||
| /** | ||
| * @brief Possible values for Vdd (measured temperature depends on it) | ||
| */ | ||
| typedef enum { | ||
| SHT1X_VDD_5_0V = 0, | ||
| SHT1X_VDD_4_0V = 1, | ||
| SHT1X_VDD_3_5V = 2, | ||
| SHT1X_VDD_3_0V = 3, | ||
| SHT1X_VDD_2_5V = 4, | ||
| } sht1x_vdd_t; | ||
|
|
||
| /** | ||
| * @brief SHT10/11/15 temperature humidity sensor | ||
| */ | ||
| typedef struct { | ||
| gpio_t clk; /**< GPIO connected to the clock pin of the SHT1X */ | ||
| gpio_t data; /**< GPIO connected to the data pin of the SHT1X */ | ||
| int16_t temp_off; /**< Offset to add to the measured temperature */ | ||
| int16_t hum_off; /**< Offset to add to the measured humidity */ | ||
| uint8_t conf; /**< Status byte (containing configuration) of the SHT1X */ | ||
| uint8_t vdd; /**< Supply voltage of the SHT1X (as sht1x_vdd_t) */ | ||
| } sht1x_dev_t; | ||
|
|
||
| /** | ||
| * @brief Parameters required to set up the SHT10/11/15 device driver | ||
| */ | ||
| typedef struct { | ||
| gpio_t clk; /**< GPIO connected to the clock pin of the SHT1X */ | ||
| gpio_t data; /**< GPIO connected to the data pin of the SHT1X */ | ||
| sht1x_vdd_t vdd; /**< The supply voltage of the SHT1X */ | ||
| } sht1x_params_t; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* SHT1X_TYPES_H */ | ||
| /** @} */ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| MODULE = auto_init_actuators_sensors | ||
|
|
||
| SRC := $(MODULE).c | ||
|
|
||
| SUBMODULES := 1 | ||
|
|
||
| include $(RIOTBASE)/Makefile.base |
27 changes: 27 additions & 0 deletions
27
sys/auto_init/actuators_sensors/auto_init_actuators_sensors.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Copyright 2020 Otto-von-Guericke-Universität Magdeburg | ||
| * | ||
| * This file is subject to the terms and conditions of the GNU Lesser General | ||
| * Public License v2.1. See the file LICENSE in the top level directory for more | ||
| * details. | ||
| */ | ||
|
|
||
| /** | ||
| * @ingroup sys_auto_init_actuators_sensors | ||
| * | ||
| * @{ | ||
| * @file | ||
| * @brief Implementation of the auto initialization of actuators and sensors | ||
| * | ||
| * @author Marian Buschsieweke <marian.buschsieweke@ovgu.de> | ||
| * | ||
| * @} | ||
| */ | ||
| #include <stdint.h> | ||
| #include <stdio.h> | ||
|
|
||
| #include "auto_init.h" | ||
|
|
||
| void auto_init_actuators_sensors(void) | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Copyright (C) 2020 Otto-von-Guericke-Universität Magdeburg | ||
| * | ||
| * This file is subject to the terms and conditions of the GNU Lesser | ||
| * General Public License v2.1. See the file LICENSE in the top level | ||
| * directory for more details. | ||
| */ | ||
|
|
||
| /** | ||
| * @defgroup sys_auto_init_actuators_sensors Actuator & Sensor Auto Initialisation | ||
| * @ingroup sys_auto_init | ||
| * @brief Auto initialisation of actuator and sensor drivers | ||
| * | ||
| * This module contains auto init functions for actuator and sensor drivers. | ||
| * | ||
| * # Architecture / Usage | ||
| * Each actuator/sensor driver "foo" capable of auto initialization must provide | ||
| * the (pseudo) module `auto_init_actuators_sensors_foo` that provides the | ||
| * auto initialization. The module `auto_init_actuators_sensors` provides the | ||
| * function `void auto_init_actuators_sensors(void)` that will call the auto | ||
| * initialisation hooks of the individual actuator and sensor drivers. | ||
| * | ||
| * Note that the auto initialization of each actuator and sensor driver must | ||
| * be individually enabled to allow the user maximum flexibility. However, | ||
| * the pseudo module `auto_init_sensors_actuators_default` will pull in the auto | ||
| * initialization hooks of all used actuator and sensor drivers. | ||
| * | ||
| * # SAUL Integration | ||
| * Each actuator driver and sensor driver auto-init hook must also register the | ||
| * SAUL endpoints (if present) if and only if the module `auto_init_saul` is | ||
| * used. | ||
| */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.