flipper_hal.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. Flipper devices inc.
  3. GPIO and HAL implementations
  4. */
  5. #pragma once
  6. #include <stdio.h>
  7. #include <stdbool.h>
  8. #include "main.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #define GPIOA "PA"
  13. #define GPIOB "PB"
  14. #define GPIOC "PC"
  15. #define GPIOD "PD"
  16. #define GPIOE "PE"
  17. #define GPIO_PIN_0 0
  18. #define GPIO_PIN_1 1
  19. #define GPIO_PIN_2 2
  20. #define GPIO_PIN_3 3
  21. #define GPIO_PIN_4 4
  22. #define GPIO_PIN_5 5
  23. #define GPIO_PIN_6 6
  24. #define GPIO_PIN_7 7
  25. #define GPIO_PIN_8 8
  26. #define GPIO_PIN_9 9
  27. #define GPIO_PIN_10 10
  28. #define GPIO_PIN_11 11
  29. #define GPIO_PIN_12 12
  30. #define GPIO_PIN_13 13
  31. #define GPIO_PIN_14 14
  32. #define GPIO_PIN_15 15
  33. #define DISPLAY_RST_GPIO_Port "DISPLAY RST"
  34. #define DISPLAY_DI_Pin 0
  35. #define DISPLAY_DI_GPIO_Port "DISPLAY DI"
  36. #define DISPLAY_RST_Pin 0
  37. #define DISPLAY_CS_GPIO_Port "DISPLAY CS"
  38. #define DISPLAY_CS_Pin 0
  39. #define DISPLAY_BACKLIGHT_GPIO_Port "BACKLIGHT"
  40. #define DISPLAY_BACKLIGHT_Pin 0
  41. typedef const char* SPI_HandleTypeDef;
  42. typedef uint32_t HAL_StatusTypeDef;
  43. HAL_StatusTypeDef
  44. HAL_SPI_Transmit(SPI_HandleTypeDef* hspi, uint8_t* pData, uint16_t Size, uint32_t Timeout);
  45. #ifdef __cplusplus
  46. }
  47. #endif