Hardware Abstraction Layer for FreeRTOS
temp_ntc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Author: Andreas Werner <kernel@andy89.org>
4  * Date: 2019
5  */
6 #ifndef TEMP_NTC_H_
7 #define TEMP_NTC_H_
8 
9 #include <temp.h>
10 #define TEMP_PRV
11 #include <temp_prv.h>
12 #include <adc.h>
13 #include <FreeRTOS.h>
14 #include <task.h>
15 extern const struct temp_ops ntc_temp_ops;
16 struct temp_ntc {
17  struct temp_generic gen;
18  struct adc *adc;
19  float Tn;
20  float B;
21  float Rn;
22  int32_t adcmax;
23 };
25 int32_t ntc_temp_connect(struct temp *temp, struct adc *adc);
26 #define TEMP_NTC(id, tn, b, rn, _adcmax) \
27  struct temp_ntc ntc_##id = { \
28  TEMP_INIT_DEV(ntc) \
29  HAL_NAME("NTC " #id) \
30  .adc = NULL, \
31  .Tn = tn, \
32  .B = b, \
33  .Rn = rn, \
34  .adcmax = _adcmax, \
35  }; \
36  TEMP_ADDDEV(ntc, ntc_##id)
37 #define TEMP_NTC_ID(id) HAL_GET_ID(temp, ntc, ntc_##id)
38 #endif
temp_generic
Definition: temp.h:44
adc.h
temp.h
ntc_temp_connect
int32_t ntc_temp_connect(struct temp *temp, struct adc *adc)
temp_prv.h