OLED_Driver.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*****************************************************************************
  2. * | File : OLED_Driver.h
  3. * | Author : Waveshare team
  4. * | Function : 0.95inch RGB OLED Module Drive function
  5. * | Info :
  6. *----------------
  7. * | This version: V2.0
  8. * | Date : 2020-08-20
  9. * | Info :
  10. * -----------------------------------------------------------------------------
  11. #
  12. # Permission is hereby granted, free of charge, to any person obtaining a copy
  13. # of this software and associated documnetation files (the "Software"), to deal
  14. # in the Software without restriction, including without limitation the rights
  15. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16. # copies of the Software, and to permit persons to whom the Software is
  17. # furished to do so, subject to the following conditions:
  18. #
  19. # The above copyright notice and this permission notice shall be included in
  20. # all copies or substantial portions of the Software.
  21. #
  22. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  25. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  27. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  28. # THE SOFTWARE.
  29. #
  30. ******************************************************************************/
  31. #ifndef __OLED_DRIVER_H
  32. #define __OLED_DRIVER_H
  33. #include "DEV_Config.h"
  34. #define DRAW_LINE 0x21
  35. #define DRAW_RECTANGLE 0x22
  36. #define COPY_WINDOW 0x23
  37. #define DIM_WINDOW 0x24
  38. #define CLEAR_WINDOW 0x25
  39. #define FILL_WINDOW 0x26
  40. #define DISABLE_FILL 0x00
  41. #define ENABLE_FILL 0x01
  42. #define CONTINUOUS_SCROLLING_SETUP 0x27
  43. #define DEACTIVE_SCROLLING 0x2E
  44. #define ACTIVE_SCROLLING 0x2F
  45. #define SET_COLUMN_ADDRESS 0x15
  46. #define SET_ROW_ADDRESS 0x75
  47. #define SET_CONTRAST_A 0x81
  48. #define SET_CONTRAST_B 0x82
  49. #define SET_CONTRAST_C 0x83
  50. #define MASTER_CURRENT_CONTROL 0x87
  51. #define SET_PRECHARGE_SPEED_A 0x8A
  52. #define SET_PRECHARGE_SPEED_B 0x8B
  53. #define SET_PRECHARGE_SPEED_C 0x8C
  54. #define SET_REMAP 0xA0
  55. #define SET_DISPLAY_START_LINE 0xA1
  56. #define SET_DISPLAY_OFFSET 0xA2
  57. #define NORMAL_DISPLAY 0xA4
  58. #define ENTIRE_DISPLAY_ON 0xA5
  59. #define ENTIRE_DISPLAY_OFF 0xA6
  60. #define INVERSE_DISPLAY 0xA7
  61. #define SET_MULTIPLEX_RATIO 0xA8
  62. #define DIM_MODE_SETTING 0xAB
  63. #define SET_MASTER_CONFIGURE 0xAD
  64. #define DIM_MODE_DISPLAY_ON 0xAC
  65. #define DISPLAY_OFF 0xAE
  66. #define NORMAL_BRIGHTNESS_DISPLAY_ON 0xAF
  67. #define POWER_SAVE_MODE 0xB0
  68. #define PHASE_PERIOD_ADJUSTMENT 0xB1
  69. #define DISPLAY_CLOCK_DIV 0xB3
  70. #define SET_GRAy_SCALE_TABLE 0xB8
  71. #define ENABLE_LINEAR_GRAY_SCALE_TABLE 0xB9
  72. #define SET_PRECHARGE_VOLTAGE 0xBB
  73. #define SET_V_VOLTAGE 0xBE
  74. /********************************************************************************
  75. function:
  76. Define the full screen height length of the display
  77. ********************************************************************************/
  78. #define OLED_0in95_RGB_WIDTH 96 //OLED width
  79. #define OLED_0in95_RGB_HEIGHT 64 //OLED height
  80. void OLED_0in95_rgb_Init(void);
  81. void OLED_0in95_rgb_Clear(void);
  82. void OLED_0in95_rgb_Set_Point(UBYTE Xpoint, UBYTE Ypoint, UWORD Color);
  83. void OLED_0in95_rgb_Display(const UBYTE *Image);
  84. #endif