st7567.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /****************************************************************************
  2. * drivers/lcd/st7567.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. /* Definitions for the ST7567 128x64 Dot Matrix LCD
  21. * Driver with C
  22. *
  23. * References:
  24. * SSD1305.pdf, "Solomon Systech SSD1305 136x64 Dot Matrix OLED/PLED
  25. * Segment/Common Driver with Controller," Solomon Systech Limited,
  26. * http://www.solomon-systech.com, May, 2008.
  27. */
  28. #ifndef __DRIVERS_LCD_ST7567_H
  29. #define __DRIVERS_LCD_ST7567_H
  30. /****************************************************************************
  31. * Included Files
  32. ****************************************************************************/
  33. /****************************************************************************
  34. * Pre-processor Definitions
  35. ****************************************************************************/
  36. /* Fundamental Commands *****************************************************/
  37. #define ST7567_DISPOFF 0xae /* 0xae: Display OFF (sleep mode) */
  38. #define ST7567_DISPON 0xaf /* 0xaf: Display ON in normal mode */
  39. #define ST7567_SETSTARTLINE 0x40 /* 0x40-7f: Set display start line */
  40. # define ST7567_STARTLINE_MASK 0x3f
  41. #define ST7567_SETPAGESTART 0xb0 /* 0xb0-b7: Set page start address */
  42. # define ST7567_PAGESTART_MASK 0x07
  43. #define ST7567_SETCOLL 0x00 /* 0x00-0x0f: Set lower column address */
  44. # define ST7567_COLL_MASK 0x0f
  45. #define ST7567_SETCOLH 0x10 /* 0x10-0x1f: Set higher column address */
  46. # define ST7567_COLH_MASK 0x0f
  47. #define SSD1305_MAPCOL0 0xa0 /* 0xa0: Column address 0 is mapped to SEG0 */
  48. #define SSD1305_MAPCOL128 0xa1 /* 0xa1: Column address 128 is mapped to SEG0 */
  49. #define ST7567_DISPNORMAL 0xa6 /* 0xa6: Normal display */
  50. #define ST7567_DISPINVERSE 0xa7 /* 0xa7: Inverse display */
  51. #define ST7567_DISPRAM 0xa4 /* 0xa4: Resume to RAM content display */
  52. #define ST7567_DISPENTIRE 0xa5 /* 0xa5: Entire display ON */
  53. #define ST7567_BIAS_1_9 0xa2 /* 0xa2: Select BIAS setting 1/9 */
  54. #define ST7567_BIAS_1_7 0xa3 /* 0xa3: Select BIAS setting 1/7 */
  55. #define ST7567_ENTER_RMWMODE 0xe0 /* 0xe0: Enter the Read Modify Write mode */
  56. #define ST7567_EXIT_RMWMODE 0xee /* 0xee: Leave the Read Modify Write mode */
  57. #define ST7567_EXIT_SOFTRST 0xe2 /* 0xe2: Software RESET */
  58. #define ST7567_SETCOMNORMAL 0xc0 /* 0xc0: Set COM output direction, normal mode */
  59. #define ST7567_SETCOMREVERSE 0xc8 /* 0xc8: Set COM output direction, reverse mode */
  60. #define ST7567_POWERCTRL_VF 0x29 /* 0x29: Control built-in power circuit */
  61. #define ST7567_POWERCTRL_VR 0x2a /* 0x2a: Control built-in power circuit */
  62. #define ST7567_POWERCTRL_VB 0x2c /* 0x2c: Control built-in power circuit */
  63. #define ST7567_POWERCTRL 0x2f /* 0x2c: Control built-in power circuit */
  64. #define ST7567_REG_RES_RR0 0x21 /* 0x21: Regulation Resistior ratio */
  65. #define ST7567_REG_RES_RR1 0x22 /* 0x22: Regulation Resistior ratio */
  66. #define ST7567_REG_RES_RR2 0x24 /* 0x24: Regulation Resistior ratio */
  67. #define ST7567_SETEV 0x81 /* 0x81: Set contrast control */
  68. #define ST7567_SETBOOSTER 0xf8 /* Set booster level */
  69. #define ST7567_SETBOOSTER4X 0x00 /* Set booster level */
  70. #define ST7567_SETBOOSTER5X 0x01 /* Set booster level */
  71. #define ST7567_NOP 0xe3 /* 0xe3: NOP Command for no operation */
  72. #endif /* __DRIVERS_LCD_ST7567_H */