api-hal-resources.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 cc1101_g0_gpio;
  48. #ifdef __cplusplus
  49. }
  50. #endif