oled_common.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef __OLED_COMMON_H
  2. #define __OLED_COMMON_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <stdbool.h>
  7. //
  8. void init_oled(void);
  9. //
  10. void init_gpio_oled(void);
  11. //
  12. void oled_reset(void);
  13. //
  14. void oled_delay_ms(uint32_t ms);
  15. //
  16. void oled_command(uint8_t com);
  17. //
  18. void oled_data(uint8_t dat);
  19. //
  20. void oled_display(void);
  21. //
  22. void oled_bitmap(uint8_t *bitmap);
  23. //
  24. void oled_invert_colors(uint8_t invert);
  25. //
  26. void oled_rotate_display(uint8_t rotate);
  27. //
  28. void oled_display_on(uint8_t on);
  29. //
  30. void oled_set_contrast(uint8_t contrast);
  31. //
  32. void oled_start_scroll_right(uint8_t start_page, uint8_t end_page, uint8_t speed);
  33. //
  34. void oled_start_scroll_left(uint8_t start_page, uint8_t end_page, uint8_t speed);
  35. //
  36. void oled_stop_scroll(void);
  37. //
  38. void oled_init(void);
  39. //
  40. void oled_draw_pixel(int16_t x, int16_t y, uint8_t color);
  41. //
  42. void oled_clear(uint8_t color);
  43. // ------------------------------------------------------------------------------- //
  44. //
  45. void oled_draw_string_frame(uint8_t str_num);
  46. //
  47. void oled_frame(uint8_t str_y, bool double_str);
  48. //
  49. void oled_int_right_alignment(int value, uint8_t char_num, char *out);
  50. //
  51. void oled_int_right_alignment_post(int value, uint8_t char_num, char *postfix, char *out);
  52. //
  53. void oled_draw_rec(int x_start, int y_start, int x_end, int y_end, uint8_t color);
  54. //
  55. void test_oled_old(void);
  56. //
  57. void test_oled(void);
  58. extern uint8_t oled_buf[];
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif // __OLED_COMMON_H