Loading...
Searching...
No Matches
f18/furi_hal/furi_hal_resources.h
1#pragma once
2
3#include <furi.h>
4#include <furi_hal_adc.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10/* Input Related Constants */
11#define INPUT_DEBOUNCE_TICKS 4
12
13/* Input Keys */
14typedef enum {
15 InputKeyUp,
16 InputKeyDown,
17 InputKeyRight,
18 InputKeyLeft,
19 InputKeyOk,
20 InputKeyBack,
21 InputKeyMAX,
22} InputKey;
23
24/* Light */
25typedef enum {
26 LightRed = (1 << 0),
27 LightGreen = (1 << 1),
28 LightBlue = (1 << 2),
29 LightBacklight = (1 << 3),
30} Light;
31
32typedef struct {
33 const GpioPin* gpio;
34 const InputKey key;
35 const bool inverted;
36 const char* name;
37} InputPin;
38
39typedef struct {
40 const GpioPin* pin;
41 const char* name;
42 const FuriHalAdcChannel channel;
43 const uint8_t number;
44 const bool debug;
46
47extern const InputPin input_pins[];
48extern const size_t input_pins_count;
49
50extern const GpioPinRecord gpio_pins[];
51extern const size_t gpio_pins_count;
52
53extern const GpioPin gpio_swdio;
54extern const GpioPin gpio_swclk;
55
56extern const GpioPin gpio_vibro;
57extern const GpioPin gpio_ibutton;
58
59extern const GpioPin gpio_display_cs;
60extern const GpioPin gpio_display_rst_n;
61extern const GpioPin gpio_display_di;
62extern const GpioPin gpio_sdcard_cs;
63extern const GpioPin gpio_sdcard_cd;
64
65extern const GpioPin gpio_button_up;
66extern const GpioPin gpio_button_down;
67extern const GpioPin gpio_button_right;
68extern const GpioPin gpio_button_left;
69extern const GpioPin gpio_button_ok;
70extern const GpioPin gpio_button_back;
71
72extern const GpioPin gpio_spi_d_miso;
73extern const GpioPin gpio_spi_d_mosi;
74extern const GpioPin gpio_spi_d_sck;
75
76extern const GpioPin gpio_ext_pc0;
77extern const GpioPin gpio_ext_pc1;
78extern const GpioPin gpio_ext_pc3;
79extern const GpioPin gpio_ext_pb2;
80extern const GpioPin gpio_ext_pb3;
81extern const GpioPin gpio_ext_pa4;
82extern const GpioPin gpio_ext_pa6;
83extern const GpioPin gpio_ext_pa7;
84
85extern const GpioPin gpio_ext_pc5;
86extern const GpioPin gpio_ext_pc4;
87extern const GpioPin gpio_ext_pa5;
88extern const GpioPin gpio_ext_pb9;
89extern const GpioPin gpio_ext_pa0;
90extern const GpioPin gpio_ext_pa1;
91extern const GpioPin gpio_ext_pa15;
92extern const GpioPin gpio_ext_pe4;
93extern const GpioPin gpio_ext_pa2;
94extern const GpioPin gpio_ext_pb4;
95extern const GpioPin gpio_ext_pb5;
96extern const GpioPin gpio_ext_pd0;
97extern const GpioPin gpio_ext_pb13;
98
99extern const GpioPin gpio_usart_tx;
100extern const GpioPin gpio_usart_rx;
101extern const GpioPin gpio_i2c_power_sda;
102extern const GpioPin gpio_i2c_power_scl;
103
104extern const GpioPin gpio_speaker;
105
106extern const GpioPin gpio_periph_power;
107
108extern const GpioPin gpio_usb_dm;
109extern const GpioPin gpio_usb_dp;
110
111void furi_hal_resources_init_early(void);
112
113void furi_hal_resources_deinit_early(void);
114
115void furi_hal_resources_init(void);
116
122int32_t furi_hal_resources_get_ext_pin_number(const GpioPin* gpio);
123
124#ifdef __cplusplus
125}
126#endif
ADC HAL API.
FuriHalAdcChannel
Definition furi_hal_adc.h:79
Gpio structure.
Definition furi_hal_gpio.h:161
Definition f18/furi_hal/furi_hal_resources.h:39
Definition f18/furi_hal/furi_hal_resources.h:32