OLED_0in96.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*****************************************************************************
  2. * | File : OLED_0in96.h
  3. * | Author : Waveshare team
  4. * | Function : OLED_0in96 OLED Module Drive function
  5. * | Info :
  6. *----------------
  7. * | This version: V2.0
  8. * | Date : 2020-08-14
  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_0IN96_H_
  32. #define _OLED_0IN96_H_
  33. #include "DEV_Config.h"
  34. #define SSD1306_SETCONTRAST 0x81
  35. #define SSD1306_DISPLAYALLON_RESUME 0xA4
  36. #define SSD1306_DISPLAYALLON 0xA5
  37. #define SSD1306_NORMALDISPLAY 0xA6
  38. #define SSD1306_INVERTDISPLAY 0xA7
  39. #define SSD1306_DISPLAYOFF 0xAE
  40. #define SSD1306_DISPLAYON 0xAF
  41. #define SSD1306_SETDISPLAYOFFSET 0xD3
  42. #define SSD1306_SETCOMPINS 0xDA
  43. #define SSD1306_SETVCOMDETECT 0xDB
  44. #define SSD1306_SETDISPLAYCLOCKDIV 0xD5
  45. #define SSD1306_SETPRECHARGE 0xD9
  46. #define SSD1306_SETMULTIPLEX 0xA8
  47. #define SSD1306_SETLOWCOLUMN 0x00
  48. #define SSD1306_SETHIGHCOLUMN 0x10
  49. #define SSD1306_SETSTARTLINE 0x40
  50. #define SSD1306_MEMORYMODE 0x20
  51. #define SSD1306_COLUMNADDR 0x21
  52. #define SSD1306_PAGEADDR 0x22
  53. #define SSD1306_COMSCANINC 0xC0
  54. #define SSD1306_COMSCANDEC 0xC8
  55. #define SSD1306_SEGREMAP 0xA0
  56. #define SSD1306_CHARGEPUMP 0x8D
  57. #define SSD1306_EXTERNALVCC 0x01
  58. #define SSD1306_SWITCHCAPVCC 0x02
  59. //Scrolling constants
  60. #define SSD1306_ACTIVATE_SCROLL 0x2F
  61. #define SSD1306_DEACTIVATE_SCROLL 0x2E
  62. #define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3
  63. #define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26
  64. #define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27
  65. #define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
  66. #define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A
  67. /********************************************************************************
  68. function:
  69. Define the full screen height length of the display
  70. ********************************************************************************/
  71. #define OLED_0in96_WIDTH 64//OLED width
  72. #define OLED_0in96_HEIGHT 128 //OLED height
  73. void OLED_0in96_Init();
  74. void OLED_0in96_clear();
  75. void OLED_0in96_display(UBYTE *Image);
  76. #endif