main/task_temp.h

changeset 32
84e54b14e7db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main/task_temp.h	Mon Apr 17 16:20:58 2023 +0200
@@ -0,0 +1,49 @@
+/**
+ * @file task_temp.h
+ * @brief The FreeRTOS task to query the chip temperature sensor.
+ *        The task will update the sensor state structures.
+ */
+
+#ifndef	_TASK_TEMP_H
+#define	_TASK_TEMP_H
+
+/*
+ * Error codes in this task
+ */
+#define	TEMP_ERR_NONE			0	///< No errors
+#define TEMP_ERR_READ			1
+
+
+/**
+ * @brief Structure containing the variables for the TEMP task.
+ */
+typedef struct {
+    bool		valid;			///< Valid measurement
+    float		temperature;		///< Temperature in celsius
+    int			error;			///< Error result
+} TEMP_State;
+
+
+
+/**
+ * @brief Request a new measurement from the temperature sensor.
+ */
+void request_temp(void);
+
+
+/**
+ * @brief Check if results are ready
+ * @return true of results are ready, else false.
+ */
+bool ready_temp(void);
+
+
+/**
+ * @brief The FreeRTOS task to update the temperature on request.
+ * @param pvParameters Parameters for the task.
+ */
+void task_temp(void *pvParameters);
+
+
+#endif
+

mercurial