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