Loading...
Searching...
No Matches
ibutton_worker_i.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <core/thread.h>
10#include <core/message_queue.h>
11
12#include "ibutton_worker.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct {
19 const uint32_t quant;
20 void (*const start)(iButtonWorker* worker);
21 void (*const tick)(iButtonWorker* worker);
22 void (*const stop)(iButtonWorker* worker);
24
25typedef enum {
26 iButtonWorkerModeIdle,
27 iButtonWorkerModeRead,
28 iButtonWorkerModeWriteId,
29 iButtonWorkerModeWriteCopy,
30 iButtonWorkerModeEmulate,
31} iButtonWorkerMode;
32
34 iButtonKey* key;
35 iButtonProtocols* protocols;
36 iButtonWorkerMode mode_index;
37 FuriMessageQueue* messages;
38 FuriThread* thread;
39
40 iButtonWorkerReadCallback read_cb;
41 iButtonWorkerWriteCallback write_cb;
42 iButtonWorkerEmulateCallback emulate_cb;
43
44 void* cb_ctx;
45};
46
47extern const iButtonWorkerModeType ibutton_worker_modes[];
48
49void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode);
50void ibutton_worker_notify_emulate(iButtonWorker* worker);
51
52#ifdef __cplusplus
53}
54#endif
iButton worker
FuriMessageQueue.
Definition message_queue.c:16
Definition thread.c:38
Definition ibutton_key.c:4
Definition ibutton_protocols.c:24
Definition ibutton_worker_i.h:33
Definition ibutton_worker_i.h:18
Furi: Furi Thread API.