Readme_EN.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*****************************************************************************
  2. * | File : Readme_CN.txt
  3. * | Author : Waveshare team
  4. * | Function : Help with use
  5. * | Info :
  6. *----------------
  7. * | This version: V1.0
  8. * | Date : 2020-08-28
  9. * | Info : Here is an English version of the documentation for your quick use.
  10. ******************************************************************************/
  11. This file is to help you use this routine.
  12. Since our OLED screens are getting more and more, it is not convenient for our maintenance, so all the OLED screen programs are made into one project.
  13. A brief description of the use of this project is here:
  14. 1. Basic information:
  15. This routine is based on the raspberry PI 4B+ development, the kernel version:
  16. Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
  17. This routine can view the corresponding test routines in the examples\ of the project;
  18. 2. Pin connection:
  19. Pin connection you can use STM32CubeMX to open the project file oled_demo.ioc for viewing, which is also repeated here:
  20. SPI:
  21. OLED => RPI(BCM)
  22. VCC -> 3.3
  23. GND -> GND
  24. DIN -> 10(MOSI)
  25. CLK -> 11(SCLK)
  26. CS -> 8
  27. DC -> 25
  28. RST -> 27
  29. IIC:
  30. OLED => RPI(BCM)
  31. VCC -> 3.3
  32. GND -> GND
  33. DIN -> 2(SDA)
  34. CLK -> 3(SCL)
  35. CS -> 8
  36. DC -> 25
  37. RST -> 27
  38. 3. Basic use:
  39. Since this project is a comprehensive project, for use, you may need to read the following:
  40. Please pay attention to which OLED you bought.
  41. eg 1:
  42. If you bought a 1.3-inch OLED Module (C), enter it in your home directory:
  43. sudo make clean
  44. sudo make
  45. sudo ./main 1.3c
  46. eg 2:
  47. If you buy a 1.5-inch RGB OLED Module, enter it in your home directory:
  48. sudo make clean
  49. sudo make
  50. sudo ./main 1.5rgb
  51. eg 3:
  52. If you buy a 0.91inch OLED Module, please note that since the Module only has IIC interface and the routine defaults to SPI, you need to modify it in config.h, that is:
  53. #define USE_SPI_4W 1
  54. #define USE_IIC 0
  55. Modified to:
  56. #define USE_SPI_4W 0
  57. #define USE_IIC 1
  58. And enter in the home directory:
  59. sudo make clean
  60. sudo make
  61. sudo ./main 0.91
  62. 4. Directory structure (selection):
  63. If you use our products frequently, we will be very familiar with our program directory structure. We have a copy of the specific function.
  64. The API manual for the function, you can download it on our WIKI or request it as an after-sales customer service. Here is a brief introduction:
  65. Config\: This directory is a hardware interface layer file. You can see many definitions in DEV_Config.c(.h), including:
  66. data type:
  67. #define UBYTE uint8_t
  68. #define UWORD uint16_t
  69. #define UDOUBLE uint32_t
  70. SPI or IIC select:
  71. #define USE_SPI_4W 1
  72. #define USE_IIC 0
  73. IIC address:
  74. #define IIC_CMD 0X00
  75. #define IIC_RAM 0X40
  76. GPIO read/write:
  77. #define OLED_CS_0 HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_RESET)
  78. #define OLED_CS_1 HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET)
  79. #define OLED_DC_0 HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, GPIO_PIN_RESET)
  80. #define OLED_DC_1 HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, GPIO_PIN_SET)
  81. #define OLED_RST_0 HAL_GPIO_WritePin(OLED_RST_GPIO_Port, OLED_RST_Pin, GPIO_PIN_RESET)
  82. #define OLED_RST_1 HAL_GPIO_WritePin(OLED_RST_GPIO_Port, OLED_RST_Pin, GPIO_PIN_SET)
  83. SPI transmission:
  84. void SPI4W_Write_Byte(UBYTE value);
  85. IIC transmission:
  86. void I2C_Write_Byte(UBYTE value, UBYTE Cmd);
  87. delay:
  88. #define DEV_Delay_ms(__xms) HAL_Delay(__xms);
  89. Note: This delay function does not use oscilloscope to measure specific values
  90. The process of module initialization and exit:
  91. UBYTE System_Init(void);
  92. void System_Exit(void);
  93. Note: Here is the processing of SOME GPIO before and after using OLED
  94. GUI\: This directory is some basic image processing functions, in GUI_Paint.c(.h):
  95. Common image processing: creating graphics, flipping graphics, mirroring graphics, setting pixels, clearing screens, etc.
  96. Common drawing processing: drawing points, lines, boxes, circles, Chinese characters, English characters, numbers, etc.;
  97. Common time display: Provide a common display time function;
  98. Commonly used display pictures: provide a function to display bitmaps;
  99. Fonts\: for some commonly used fonts:
  100. Ascii:
  101. Font8: 5*8
  102. Font12: 7*12
  103. Font16: 11*16
  104. Font20: 14*20
  105. Font24: 17*24
  106. Chinese:
  107. font12CN: 16*21
  108. font24CN: 32*41
  109. OLED\: This screen is the OLED screen driver function;
  110. Examples\: This is the test program for the OLED screen. You can see the specific usage method in it.