main.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifndef __MAIN_H__
  3. #define __MAIN_H__
  4. #include "buttons.h"
  5. /* Private defines */
  6. #define TOP_INFO_1_X 0
  7. #define TOP_INFO_1_Y 0
  8. #define TOP_INFO_2_X 120
  9. #define TOP_INFO_2_Y 0
  10. #define LCD_LINE_1 23
  11. #define LCD_LINE_2 33
  12. #define LCD_LINE_3 43
  13. #define LCD_LINE_4 53
  14. #define LCD_LINE_5 63
  15. #define LCD_LINE_6 73
  16. #define LCD_LINE_7 83
  17. #define LCD_LINE_8 93
  18. #define LCD_LINE_9 103
  19. /* Private variables */
  20. /*
  21. * SPI configuration structure.
  22. * Speed 12 MHz, CPHA=0, CPOL=0, 8bits frames, MSb transmitted first.
  23. * Soft slave select.
  24. */
  25. static const SPIConfig spi1cfg = {
  26. .circular = false,
  27. .slave = false,
  28. .data_cb = NULL,
  29. .error_cb = NULL,
  30. .cr1 = 0U,
  31. .cr2 = 0U
  32. };
  33. /* Private function prototypes */
  34. static void btn1_handler(const button_state_t);
  35. static void btn2_handler(const button_state_t);
  36. static void btn3_handler(const button_state_t);
  37. static void btn4_handler(const button_state_t);
  38. static btn_hndlr bha[Button_Num] = {
  39. btn1_handler,
  40. btn2_handler,
  41. btn3_handler,
  42. btn4_handler
  43. };
  44. static void lcd_MainScreen(void);
  45. static void lcd_ClearMain(void);
  46. static uint8_t X_centered(const uint8_t len, const uint8_t pix);
  47. #endif /* __MAIN_H__ */