Flipper Zero Firmware
Loading...
Searching...
No Matches
devices/types.h
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5#include <stddef.h>
6
7#include <furi.h>
8#include <furi_hal.h>
9
10#include "preset.h"
11
13
14#define SUBGHZ_RADIO_DEVICE_PLUGIN_APP_ID "subghz_radio_device"
15#define SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION 1
16
18typedef struct SubGhzDevice SubGhzDevice;
19
20typedef bool (*SubGhzBegin)(void);
21typedef void (*SubGhzEnd)(void);
22typedef bool (*SubGhzIsConnect)(void);
23typedef void (*SubGhzReset)(void);
24typedef void (*SubGhzSleep)(void);
25typedef void (*SubGhzIdle)(void);
26typedef void (*SubGhzLoadPreset)(FuriHalSubGhzPreset preset, uint8_t* preset_data);
27typedef uint32_t (*SubGhzSetFrequency)(uint32_t frequency);
28typedef bool (*SubGhzIsFrequencyValid)(uint32_t frequency);
29
30typedef void (*SubGhzSetAsyncMirrorPin)(const GpioPin* gpio);
31typedef const GpioPin* (*SubGhzGetDataGpio)(void);
32
33typedef bool (*SubGhzSetTx)(void);
34typedef void (*SubGhzFlushTx)(void);
35typedef bool (*SubGhzStartAsyncTx)(void* callback, void* context);
36typedef bool (*SubGhzIsAsyncCompleteTx)(void);
37typedef void (*SubGhzStopAsyncTx)(void);
38
39typedef void (*SubGhzSetRx)(void);
40typedef void (*SubGhzFlushRx)(void);
41typedef void (*SubGhzStartAsyncRx)(void* callback, void* context);
42typedef void (*SubGhzStopAsyncRx)(void);
43
44typedef float (*SubGhzGetRSSI)(void);
45typedef uint8_t (*SubGhzGetLQI)(void);
46
47typedef bool (*SubGhzRxPipeNotEmpty)(void);
48typedef bool (*SubGhzRxIsDataCrcValid)(void);
49typedef void (*SubGhzReadPacket)(uint8_t* data, uint8_t* size);
50typedef void (*SubGhzWritePacket)(const uint8_t* data, uint8_t size);
51
52typedef struct {
53 SubGhzBegin begin;
54 SubGhzEnd end;
55
56 SubGhzIsConnect is_connect;
57 SubGhzReset reset;
58 SubGhzSleep sleep;
59 SubGhzIdle idle;
60
61 SubGhzLoadPreset load_preset;
62 SubGhzSetFrequency set_frequency;
63 SubGhzIsFrequencyValid is_frequency_valid;
64 SubGhzSetAsyncMirrorPin set_async_mirror_pin;
65 SubGhzGetDataGpio get_data_gpio;
66
67 SubGhzSetTx set_tx;
68 SubGhzFlushTx flush_tx;
69 SubGhzStartAsyncTx start_async_tx;
70 SubGhzIsAsyncCompleteTx is_async_complete_tx;
71 SubGhzStopAsyncTx stop_async_tx;
72
73 SubGhzSetRx set_rx;
74 SubGhzFlushRx flush_rx;
75 SubGhzStartAsyncRx start_async_rx;
76 SubGhzStopAsyncRx stop_async_rx;
77
78 SubGhzGetRSSI get_rssi;
79 SubGhzGetLQI get_lqi;
80
81 SubGhzRxPipeNotEmpty rx_pipe_not_empty;
82 SubGhzRxIsDataCrcValid is_rx_data_crc_valid;
83 SubGhzReadPacket read_packet;
84 SubGhzWritePacket write_packet;
85
87
89 const char* name;
90 const SubGhzDeviceInterconnect* interconnect;
91};
Flipper application.
Furi HAL API.
Gpio structure.
Definition furi_hal_gpio.h:161
Definition devices/types.h:88
Definition devices/types.h:52
Definition devices/registry.c:9