api-hal-resources.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <api-hal-resources.h>
  2. #include "main.h"
  3. #include <furi.h>
  4. const InputPin input_pins[] = {
  5. {.port = BUTTON_UP_GPIO_Port, .pin = BUTTON_UP_Pin, .key = InputKeyUp, .inverted = true},
  6. {.port = BUTTON_DOWN_GPIO_Port,
  7. .pin = BUTTON_DOWN_Pin,
  8. .key = InputKeyDown,
  9. .inverted = true},
  10. {.port = BUTTON_RIGHT_GPIO_Port,
  11. .pin = BUTTON_RIGHT_Pin,
  12. .key = InputKeyRight,
  13. .inverted = true},
  14. {.port = BUTTON_LEFT_GPIO_Port,
  15. .pin = BUTTON_LEFT_Pin,
  16. .key = InputKeyLeft,
  17. .inverted = true},
  18. {.port = BUTTON_OK_GPIO_Port, .pin = BUTTON_OK_Pin, .key = InputKeyOk, .inverted = false},
  19. {.port = BUTTON_BACK_GPIO_Port,
  20. .pin = BUTTON_BACK_Pin,
  21. .key = InputKeyBack,
  22. .inverted = true},
  23. };
  24. const size_t input_pins_count = sizeof(input_pins) / sizeof(InputPin);
  25. const GpioPin vibro_gpio = {VIBRO_GPIO_Port, VIBRO_Pin};
  26. const GpioPin ibutton_gpio = {iBTN_GPIO_Port, iBTN_Pin};
  27. const GpioPin cc1101_g0_gpio = {CC1101_G0_GPIO_Port, CC1101_G0_Pin};
  28. const GpioPin gpio_subghz_cs = { .port=CC1101_CS_GPIO_Port, .pin=CC1101_CS_Pin };
  29. const GpioPin gpio_display_cs = { .port=DISPLAY_CS_GPIO_Port, .pin=DISPLAY_CS_Pin };
  30. const GpioPin gpio_display_rst = { .port=DISPLAY_RST_GPIO_Port, .pin=DISPLAY_RST_Pin };
  31. const GpioPin gpio_display_di = { .port=DISPLAY_DI_GPIO_Port, .pin=DISPLAY_DI_Pin };
  32. const GpioPin gpio_sdcard_cs = { .port=SD_CS_GPIO_Port, .pin=SD_CS_Pin };
  33. const GpioPin gpio_nfc_cs = { .port=NFC_CS_GPIO_Port, .pin=NFC_CS_Pin };
  34. const GpioPin gpio_spi_d_miso = { .port=SPI_D_MISO_GPIO_Port, .pin=SPI_D_MISO_Pin };
  35. const GpioPin gpio_spi_d_mosi = { .port=SPI_D_MOSI_GPIO_Port, .pin=SPI_D_MOSI_Pin };
  36. const GpioPin gpio_spi_d_sck = { .port=SPI_D_SCK_GPIO_Port, .pin=SPI_D_SCK_Pin };
  37. const GpioPin gpio_spi_r_miso = { .port=SPI_R_MISO_GPIO_Port, .pin=SPI_R_MISO_Pin };
  38. const GpioPin gpio_spi_r_mosi = { .port=SPI_R_MOSI_GPIO_Port, .pin=SPI_R_MOSI_Pin };
  39. const GpioPin gpio_spi_r_sck = { .port=SPI_R_SCK_GPIO_Port, .pin=SPI_R_SCK_Pin };
  40. // external gpio's
  41. const GpioPin ext_pc0_gpio = {.port = GPIOC, .pin = GPIO_PIN_0};
  42. const GpioPin ext_pc1_gpio = {.port = GPIOC, .pin = GPIO_PIN_1};
  43. const GpioPin ext_pc3_gpio = {.port = GPIOC, .pin = GPIO_PIN_3};
  44. const GpioPin ext_pb2_gpio = {.port = GPIOB, .pin = GPIO_PIN_2};
  45. const GpioPin ext_pb3_gpio = {.port = GPIOB, .pin = GPIO_PIN_3};
  46. const GpioPin ext_pa4_gpio = {.port = GPIOA, .pin = GPIO_PIN_4};
  47. const GpioPin ext_pa6_gpio = {.port = GPIOA, .pin = GPIO_PIN_6};
  48. const GpioPin ext_pa7_gpio = {.port = GPIOA, .pin = GPIO_PIN_7};