api-hal-resources.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. #define POWER_I2C_SCL_Pin LL_GPIO_PIN_9
  10. #define POWER_I2C_SCL_GPIO_Port GPIOA
  11. #define POWER_I2C_SDA_Pin LL_GPIO_PIN_10
  12. #define POWER_I2C_SDA_GPIO_Port GPIOA
  13. #define POWER_I2C I2C1
  14. /** Timing register value is computed with the STM32CubeMX Tool,
  15. * Fast Mode @100kHz with I2CCLK = 64 MHz,
  16. * rise time = 0ns, fall time = 0ns
  17. */
  18. #define POWER_I2C_TIMINGS 0x10707DBC
  19. /* Input Related Constants */
  20. #define INPUT_DEBOUNCE_TICKS 20
  21. /* Input Keys */
  22. typedef enum {
  23. InputKeyUp,
  24. InputKeyDown,
  25. InputKeyRight,
  26. InputKeyLeft,
  27. InputKeyOk,
  28. InputKeyBack,
  29. } InputKey;
  30. /* Light */
  31. typedef enum {
  32. LightRed,
  33. LightGreen,
  34. LightBlue,
  35. LightBacklight,
  36. } Light;
  37. typedef struct {
  38. const GPIO_TypeDef* port;
  39. const uint16_t pin;
  40. const InputKey key;
  41. const bool inverted;
  42. } InputPin;
  43. extern const InputPin input_pins[];
  44. extern const size_t input_pins_count;
  45. extern const GpioPin vibro_gpio;
  46. extern const GpioPin ibutton_gpio;
  47. extern const GpioPin gpio_cc1101_g0;
  48. extern const GpioPin gpio_rf_sw_0;
  49. extern const GpioPin gpio_rf_sw_1;
  50. extern const GpioPin gpio_subghz_cs;
  51. extern const GpioPin gpio_display_cs;
  52. extern const GpioPin gpio_display_rst;
  53. extern const GpioPin gpio_display_di;
  54. extern const GpioPin gpio_sdcard_cs;
  55. extern const GpioPin gpio_nfc_cs;
  56. extern const GpioPin gpio_spi_d_miso;
  57. extern const GpioPin gpio_spi_d_mosi;
  58. extern const GpioPin gpio_spi_d_sck;
  59. extern const GpioPin gpio_spi_r_miso;
  60. extern const GpioPin gpio_spi_r_mosi;
  61. extern const GpioPin gpio_spi_r_sck;
  62. extern const GpioPin gpio_ext_pc0;
  63. extern const GpioPin gpio_ext_pc1;
  64. extern const GpioPin gpio_ext_pc3;
  65. extern const GpioPin gpio_ext_pb2;
  66. extern const GpioPin gpio_ext_pb3;
  67. extern const GpioPin gpio_ext_pa4;
  68. extern const GpioPin gpio_ext_pa6;
  69. extern const GpioPin gpio_ext_pa7;
  70. extern const GpioPin gpio_rfid_pull;
  71. extern const GpioPin gpio_rfid_carrier_out;
  72. extern const GpioPin gpio_rfid_data_in;
  73. #ifdef __cplusplus
  74. }
  75. #endif