flipper_hal.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define GPIOA "PA"
  10. #define GPIOB "PB"
  11. #define GPIOC "PC"
  12. #define GPIOD "PD"
  13. #define GPIOE "PE"
  14. #define GPIO_PIN_0 0
  15. #define GPIO_PIN_1 1
  16. #define GPIO_PIN_2 2
  17. #define GPIO_PIN_3 3
  18. #define GPIO_PIN_4 4
  19. #define GPIO_PIN_5 5
  20. #define GPIO_PIN_6 6
  21. #define GPIO_PIN_7 7
  22. #define GPIO_PIN_8 8
  23. #define GPIO_PIN_9 9
  24. #define GPIO_PIN_10 10
  25. #define GPIO_PIN_11 11
  26. #define GPIO_PIN_12 12
  27. #define GPIO_PIN_13 13
  28. #define GPIO_PIN_14 14
  29. #define GPIO_PIN_15 15
  30. #define DISPLAY_RST_GPIO_Port "DISPLAY RST"
  31. #define DISPLAY_DI_Pin 0
  32. #define DISPLAY_DI_GPIO_Port "DISPLAY DI"
  33. #define DISPLAY_RST_Pin 0
  34. #define DISPLAY_CS_GPIO_Port "DISPLAY CS"
  35. #define DISPLAY_CS_Pin 0
  36. #define DISPLAY_BACKLIGHT_GPIO_Port "BACKLIGHT"
  37. #define DISPLAY_BACKLIGHT_Pin 0
  38. typedef const char* SPI_HandleTypeDef;
  39. typedef uint32_t HAL_StatusTypeDef;
  40. HAL_StatusTypeDef
  41. HAL_SPI_Transmit(SPI_HandleTypeDef* hspi, uint8_t* pData, uint16_t Size, uint32_t Timeout);