api-hal-resources.h 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 I2C_SCL_Pin LL_GPIO_PIN_9
  10. #define I2C_SCL_GPIO_Port GPIOA
  11. #define I2C_SDA_Pin LL_GPIO_PIN_10
  12. #define I2C_SDA_GPIO_Port GPIOA
  13. #define POWER_I2C I2C1
  14. /* Input Related Constants */
  15. #define INPUT_DEBOUNCE_TICKS 20
  16. /* Input Keys */
  17. typedef enum {
  18. InputKeyUp,
  19. InputKeyDown,
  20. InputKeyRight,
  21. InputKeyLeft,
  22. InputKeyOk,
  23. InputKeyBack,
  24. } InputKey;
  25. /* Light */
  26. typedef enum {
  27. LightRed,
  28. LightGreen,
  29. LightBlue,
  30. LightBacklight,
  31. } Light;
  32. typedef struct {
  33. const GPIO_TypeDef* port;
  34. const uint16_t pin;
  35. const InputKey key;
  36. const bool inverted;
  37. } InputPin;
  38. extern const InputPin input_pins[];
  39. extern const size_t input_pins_count;
  40. extern const GpioPin sd_cs_gpio;
  41. extern const GpioPin vibro_gpio;
  42. extern const GpioPin ibutton_gpio;
  43. extern const GpioPin cc1101_g0_gpio;
  44. #ifdef __cplusplus
  45. }
  46. #endif