mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-21 10:13:10 +00:00
611b7e15ed
* Add permission fix (no execute bit for source files) to fbt lint|format * Remove execute bit from 59 source files using fbt format * Also list which permissions are unwanted in lint.py * Also remove exec permissions from lib/../rfal_nfc.c Co-authored-by: あく <alleteam@gmail.com>
45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "picopass_device.h"
|
|
|
|
typedef struct PicopassWorker PicopassWorker;
|
|
|
|
typedef enum {
|
|
// Init states
|
|
PicopassWorkerStateNone,
|
|
PicopassWorkerStateBroken,
|
|
PicopassWorkerStateReady,
|
|
// Main worker states
|
|
PicopassWorkerStateDetect,
|
|
// Transition
|
|
PicopassWorkerStateStop,
|
|
} PicopassWorkerState;
|
|
|
|
typedef enum {
|
|
// Reserve first 50 events for application events
|
|
PicopassWorkerEventReserved = 50,
|
|
|
|
// Picopass worker common events
|
|
PicopassWorkerEventSuccess,
|
|
PicopassWorkerEventFail,
|
|
PicopassWorkerEventNoCardDetected,
|
|
|
|
PicopassWorkerEventStartReading,
|
|
} PicopassWorkerEvent;
|
|
|
|
typedef void (*PicopassWorkerCallback)(PicopassWorkerEvent event, void* context);
|
|
|
|
PicopassWorker* picopass_worker_alloc();
|
|
|
|
PicopassWorkerState picopass_worker_get_state(PicopassWorker* picopass_worker);
|
|
|
|
void picopass_worker_free(PicopassWorker* picopass_worker);
|
|
|
|
void picopass_worker_start(
|
|
PicopassWorker* picopass_worker,
|
|
PicopassWorkerState state,
|
|
PicopassDeviceData* dev_data,
|
|
PicopassWorkerCallback callback,
|
|
void* context);
|
|
|
|
void picopass_worker_stop(PicopassWorker* picopass_worker);
|