furi_hal_resources.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include "main.h"
  3. #include <furi.h>
  4. #include <stm32wbxx.h>
  5. #include <stm32wbxx_ll_gpio.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /* Input Related Constants */
  10. #define INPUT_DEBOUNCE_TICKS 20
  11. /* Input Keys */
  12. typedef enum {
  13. InputKeyUp,
  14. InputKeyDown,
  15. InputKeyRight,
  16. InputKeyLeft,
  17. InputKeyOk,
  18. InputKeyBack,
  19. } InputKey;
  20. /* Light */
  21. typedef enum {
  22. LightRed,
  23. LightGreen,
  24. LightBlue,
  25. LightBacklight,
  26. } Light;
  27. typedef struct {
  28. const GPIO_TypeDef* port;
  29. const uint16_t pin;
  30. const InputKey key;
  31. const bool inverted;
  32. const char* name;
  33. } InputPin;
  34. extern const InputPin input_pins[];
  35. extern const size_t input_pins_count;
  36. extern const GpioPin vibro_gpio;
  37. extern const GpioPin ibutton_gpio;
  38. extern const GpioPin gpio_cc1101_g0;
  39. extern const GpioPin gpio_rf_sw_0;
  40. extern const GpioPin gpio_subghz_cs;
  41. extern const GpioPin gpio_display_cs;
  42. extern const GpioPin gpio_display_rst;
  43. extern const GpioPin gpio_display_di;
  44. extern const GpioPin gpio_sdcard_cs;
  45. extern const GpioPin gpio_nfc_cs;
  46. extern const GpioPin gpio_spi_d_miso;
  47. extern const GpioPin gpio_spi_d_mosi;
  48. extern const GpioPin gpio_spi_d_sck;
  49. extern const GpioPin gpio_spi_r_miso;
  50. extern const GpioPin gpio_spi_r_mosi;
  51. extern const GpioPin gpio_spi_r_sck;
  52. extern const GpioPin gpio_ext_pc0;
  53. extern const GpioPin gpio_ext_pc1;
  54. extern const GpioPin gpio_ext_pc3;
  55. extern const GpioPin gpio_ext_pb2;
  56. extern const GpioPin gpio_ext_pb3;
  57. extern const GpioPin gpio_ext_pa4;
  58. extern const GpioPin gpio_ext_pa6;
  59. extern const GpioPin gpio_ext_pa7;
  60. extern const GpioPin gpio_rfid_pull;
  61. extern const GpioPin gpio_rfid_carrier_out;
  62. extern const GpioPin gpio_rfid_data_in;
  63. extern const GpioPin gpio_rfid_carrier;
  64. extern const GpioPin gpio_infrared_rx;
  65. extern const GpioPin gpio_infrared_tx;
  66. extern const GpioPin gpio_usart_tx;
  67. extern const GpioPin gpio_usart_rx;
  68. extern const GpioPin gpio_i2c_power_sda;
  69. extern const GpioPin gpio_i2c_power_scl;
  70. #ifdef __cplusplus
  71. }
  72. #endif