47 lines
862 B
C
47 lines
862 B
C
/*
|
|
* UserInput.h
|
|
*
|
|
* Created on: Jun 3, 2021
|
|
* Author: zemon
|
|
*/
|
|
|
|
#ifndef USER_INPUT_INC_USERINPUT_H_
|
|
#define USER_INPUT_INC_USERINPUT_H_
|
|
|
|
#include "UserInputButtonWatcher.h"
|
|
|
|
typedef struct {
|
|
tGpioPin additional;
|
|
tGpioPin emergency;
|
|
} tUserInputPins;
|
|
|
|
typedef enum {
|
|
UI_BUTTON_EMERGENCY,
|
|
UI_BUTTON_ADDITIONAL,
|
|
} eUserInputButtonIds;
|
|
|
|
typedef struct {
|
|
struct {
|
|
tUserInputButtonWatch watches[2];
|
|
} mem;
|
|
tUserInputButtonWatcher watcher;
|
|
tUserButtonsInterface buttonsInterface;
|
|
|
|
struct {
|
|
osThreadId_t id;
|
|
uint32_t stack[512];
|
|
StaticTask_t controlBlock;
|
|
osThreadAttr_t attr;
|
|
} thread;
|
|
} tUserInput;
|
|
|
|
|
|
void UserInput_Init(
|
|
tUserInput *env,
|
|
tUserInputPins *userInputPins
|
|
);
|
|
|
|
void UserInput_StartThread(tUserInput *env);
|
|
|
|
#endif /* USER_INPUT_INC_USERINPUT_H_ */
|