summaryrefslogtreecommitdiff
path: root/app/light_sensor/light_sensor_task.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-03-05 20:20:45 +0300
committerOxore <oxore@protonmail.com>2023-03-05 20:20:45 +0300
commitea807de65b0485ac58b6eae576209c64d4d5c4e9 (patch)
treeb4264d20e1d700cfd9e0ece9d847a825dd1dfc03 /app/light_sensor/light_sensor_task.h
parentdd01e7ed22cea652061f0d12cecf929e04b285e9 (diff)
Split app code and third party libraries
Diffstat (limited to 'app/light_sensor/light_sensor_task.h')
-rw-r--r--app/light_sensor/light_sensor_task.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/light_sensor/light_sensor_task.h b/app/light_sensor/light_sensor_task.h
new file mode 100644
index 0000000..65dbba9
--- /dev/null
+++ b/app/light_sensor/light_sensor_task.h
@@ -0,0 +1,24 @@
+#ifndef LIGHT_SENSOR_TASK_INCLUDED
+#define LIGHT_SENSOR_TASK_INCLUDED
+
+#include "stm32f0xx_conf.h"
+
+#define LIGHT_SENSOR_GPIO_PINx GPIO_Pin_6
+#define LIGHT_SENSOR_GPIOx GPIOA
+#define LIGHT_SENSOR_RCC_AHBPeriph_GPIOx RCC_AHBPeriph_GPIOA
+
+#define LIGHT_SENSOR_ADCx ADC1
+#define LIGHT_SENSOR_ADC_Channelx ADC_Channel_6
+#define LIGHT_SENSOR_RCC_APBxPeriphClockCmd RCC_APB2PeriphClockCmd
+#define LIGHT_SENSOR_RCC_APBxPeriph_ADCx RCC_APB2Periph_ADC1
+
+typedef enum {
+ LIGHT_SENSOR_STATE_LIGHT,
+ LIGHT_SENSOR_STATE_DARK
+} LightSensorState_t;
+
+void LightSensorInit ( void );
+
+void LightSensor_Task ( void *pvParameters );
+
+#endif //LIGHT_SENSOR_TASK_INCLUDED