OLED transplant program in the stm32f103

    Garden recently bought the 5.5-inch OLED display, an official for the driver is on stm32f103VC version, since the display on stm32f103c8t6, ​​so the need for transplantation.

 

Basic: The official to routine is simulated using the GPIO port SPI driver LCD display

1, modified GPIO port, the analog display OLED GPIO port group to replace all GPIO port on some stm32f103c8t6

2, files modified chip capacity .S

      Because .S file stm32f103vc using starup_stm32f10x_hd.s

      The .S file stm32f103c8t6 using starup_stm32f10x_md.s

3, modify the chip models

      In the device under the hammer types of buttons, the chip model modified bit stm32f103c8t6 from stm32f103VC

4, modify the macro definition

     Under the hammer at C models buttons / C ++, under the Define Preprocessor Symbols of STM32F10X_HD modified to STM32F10X_MD

     ---------------------------------

      In Define under Preprocessor Symbols in

                       USE_STDPERIPH_DRIVER tells the compiler, we need to use the standard library, which is a .c / .h file which defines macros

                       STM32F10x_HD tells the compiler to indicate the chip we are using the high-capacity stm32, tell those .c / .h files, use the code.

    -----------------------------------

These are all of the steps transplant,

   In the absence of the fourth step, error will appear: # 67: expected a "}" mistakes, because that is the definition of a STM32F10X_HD in engineering configuration, while the actual use is STM32F10X_MD

      

      

Guess you like

Origin www.cnblogs.com/cjyc/p/11111370.html