|
1 /** |
|
2 * @file task_temp.h |
|
3 * @brief The FreeRTOS task to query the chip temperature sensor. |
|
4 * The task will update the sensor state structures. |
|
5 */ |
|
6 |
|
7 #ifndef _TASK_TEMP_H |
|
8 #define _TASK_TEMP_H |
|
9 |
|
10 /* |
|
11 * Error codes in this task |
|
12 */ |
|
13 #define TEMP_ERR_NONE 0 ///< No errors |
|
14 #define TEMP_ERR_READ 1 |
|
15 |
|
16 |
|
17 /** |
|
18 * @brief Structure containing the variables for the TEMP task. |
|
19 */ |
|
20 typedef struct { |
|
21 bool valid; ///< Valid measurement |
|
22 float temperature; ///< Temperature in celsius |
|
23 int error; ///< Error result |
|
24 } TEMP_State; |
|
25 |
|
26 |
|
27 |
|
28 /** |
|
29 * @brief Request a new measurement from the temperature sensor. |
|
30 */ |
|
31 void request_temp(void); |
|
32 |
|
33 |
|
34 /** |
|
35 * @brief Check if results are ready |
|
36 * @return true of results are ready, else false. |
|
37 */ |
|
38 bool ready_temp(void); |
|
39 |
|
40 |
|
41 /** |
|
42 * @brief The FreeRTOS task to update the temperature on request. |
|
43 * @param pvParameters Parameters for the task. |
|
44 */ |
|
45 void task_temp(void *pvParameters); |
|
46 |
|
47 |
|
48 #endif |
|
49 |