Merged i2c-helper in Main
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#define CORE_MASK_GOBOTRPC 0b10
|
||||
#define CORE_MASK_VACUM 0b01
|
||||
|
||||
#define LED1_PIN 16
|
||||
#define LED2_PIN 25
|
||||
|
||||
#define RELAY_PIN 15
|
||||
|
||||
#define GORPC_INT_PIN 2
|
||||
#define GORPC_SDA_PIN 4
|
||||
#define GORPC_SCL_PIN 5
|
||||
|
||||
#define BUTTON_PIN 17
|
||||
|
||||
#define INTERRUPTION_DURATION ((int)(2.5 * 1000))
|
||||
#define INTERRUPTION_DELAY 5 * 1000
|
||||
|
||||
#define I2C_ADDR 0x21
|
||||
29
vacum-control/vacum-control-firmware/include/vacum.hpp
Normal file
29
vacum-control/vacum-control-firmware/include/vacum.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include "pinConfigNode.hpp"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "semphr.h"
|
||||
|
||||
void vInterruptionTaskFn(void *pvParameters);
|
||||
void vButtonTaskFn(void *pvParameters);
|
||||
|
||||
class VacumControl {
|
||||
private:
|
||||
uint coreMask;
|
||||
bool state = false;
|
||||
xSemaphoreHandle vacumMutex;
|
||||
xSemaphoreHandle interruptionSemaphore;
|
||||
|
||||
xTaskHandle interruptionTask;
|
||||
xTaskHandle buttonTask;
|
||||
public:
|
||||
VacumControl(uint coreMask);
|
||||
|
||||
void initVacumPins();
|
||||
void setState(bool on);
|
||||
|
||||
void interruptionTaskFn();
|
||||
void buttonTaskFn();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user