forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LTD noup] drivers: sensor: add stm32f401x temperature driver
There is an issue with this driver. At present, there's no good way for board-level configuration (specifically, the voltages on the V_REF- and V_REF+ external pins, which are needed to convert ADC values to volts) to be made available portably to drivers. Hack around this here by hard-coding reasonable defaults of 0V for V_REF- and 3.3V for V_REF+. Signed-off-by: Marti Bolivar <[email protected]>
- Loading branch information
Showing
2 changed files
with
223 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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,26 @@ | ||
/* | ||
* Copyright (c) 2017 Linaro Limited. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef _STM32_TEMP_H_ | ||
#define _STM32_TEMP_H_ | ||
|
||
#include <stdint.h> | ||
|
||
#include <device.h> | ||
#include <soc.h> | ||
|
||
struct temp_stm32_config { | ||
ADC_TypeDef *adc; | ||
ADC_Common_TypeDef *adc_common; | ||
u8_t adc_channel; | ||
struct stm32_pclken pclken; | ||
}; | ||
|
||
struct temp_stm32_data { | ||
struct device *clock; | ||
}; | ||
|
||
#endif /* _STM32_TEMP_H_ */ |
This file contains 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