add firmware
This commit is contained in:
parent
f165ccdc95
commit
580bc8716c
21 changed files with 6148 additions and 0 deletions
34
firmware/main/include/ui/inputs.h
Normal file
34
firmware/main/include/ui/inputs.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <freertos/event_groups.h>
|
||||
|
||||
#define INPUTS_TAG ("INPUT")
|
||||
|
||||
extern TaskHandle_t T_ReadInputs_Handle;
|
||||
extern EventGroupHandle_t EV_InputEventGroupHandle;
|
||||
|
||||
typedef enum InputEventGroupFlags {
|
||||
INPUT_EVENT_WHEEL = (1 << 0),
|
||||
INPUT_EVENT_KEY_FORWARD = (1 << 1),
|
||||
INPUT_EVENT_KEY_BACKSPACE = (1 << 2),
|
||||
INPUT_EVENT_KEY_DONE = (1 << 3),
|
||||
INPUT_EVENT_KEY_CANCEL = (1 << 4),
|
||||
INPUT_EVENT_KEY_OPTION = (1 << 5)
|
||||
} UIEventGroupFlags_t;
|
||||
|
||||
typedef struct InputState {
|
||||
bool forward, backspace, done, cancel, option;
|
||||
int wheel;
|
||||
uint8_t _wheelQuadrant;
|
||||
} InputState_t;
|
||||
|
||||
void init_inputs();
|
||||
|
||||
InputState_t waitForInputEvents(UIEventGroupFlags_t events, BaseType_t xWaitForAll, TickType_t xTicksToWait);
|
||||
|
||||
InputState_t getInputState();
|
||||
Loading…
Add table
Add a link
Reference in a new issue