How to use Oled on hikey960?  

分享到:

wolfkin
Level 2Admin
注册时间:8年 前
帖子数: 27
2017年7月12日 上午10:49  

I porting OLED on hikey960 recently

This document describes how to use OLED on hikey

 

Hardware preparation:

Hikey960

96Boards Sensors

Grove系列-OLED Display 1.12"

 

Let's talk about the details of the drive:

 

In aosp\hikey-linaro\arch\arm64\boot\dts\hisilicon\hi3660.dtsi

Add information about OLED in dts like below:

                   i2c0: i2c@FFD71000 {

                            compatible = "snps,designware-i2c";

                            reg = <0x0 0xFFD71000 0x0 0x1000>;

                            interrupts = <0 118 4>;

                        #address-cells = <1>;

                        #size-cells = <0>;

                            clock-frequency = <400000>;

                            clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>;

                            resets = <&iomcu_rst HI3660_RST_I2C0>;

                            pinctrl-names = "default";

                            pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;

                            status = "ok";

                           

                            oled:oled@0x3c {

                                     compatible = "grove,oled";

                                     reg = <0x3c>;

                                     status = "ok";

                            };

Put the code under the aosp\hikey-linaro\drivers directory, and then configure the kconfig and Makefile in this directory like below:

 

Added in Kconfig:

source "drivers/oled/Kconfig"

 

Added in Makefile:

obj-y          += oled/

 

Finally, add macros to the file in \aosp\hikey-linaro\arch\arm64\configs\hikey960_defconfig

CONFIG_OLED=y

 

The next step is to compile. First compile kernel, then rename the image.gz and DTB files and put them into AOSP, and finally complete the aosp. After compiling, burn image.

 

If the boot is normal, you can see the logo as shown

 

 

Finally, give the code to everyone

 

https://github.com/archermind666/oled_on_hikey960

编辑:8年 前

回复引用
  
Working

登陆 或者 注册