Linux I2C驱动分析4 - GPIO模拟I2C

news2024/11/28 5:28:13

一. 前言

        在嵌入式开发中,由于芯片的I2C接口有限,或者出于硬件画板的方便,我们都需要将普通的GPIO模拟I2C接口使用。出于对这样的需求,Linux-2.6.x已经有相关代码了,Linux-3.x有标准的内核选项支持该功能,内核的代码位于linux_kernel/drivers/i2c/busses/i2c-gpio.c,本文主要介绍怎么使用i2c-gpio模块。本文的内核使用的是内核版本是linux-3.18.45,CPU是MT7620。

二. 详细步骤

1. 开启内核选项

        开启CONFIG_I2C_GPIO选项。示例如下

CONFIG_I2C_GPIO:
                                                                                                                                                                                                                
This is a very simple bitbanging I2C driver utilizing the                                                                                                                                                                           
arch-neutral GPIO API to control the SCL and SDA lines.    
                                                                                                                                                                         
Symbol: I2C_GPIO [=y]                                                                                                                                                                                                               
Type  : tristate                                                                                                                                                                                                                    
Prompt: GPIO-based bitbanging I2C                                                                                                                                                                                                   
  Location:                                                                                                                                                                                                                         
    -> Device Drivers                                                                                                                                                                                                               
      -> I2C support                                                                                                                                                                                                                
        -> I2C support (I2C [=y])                                                                                                                                                                                                   
          -> I2C Hardware Bus support                                                                                                                                                                                               
  Defined at drivers/i2c/busses/Kconfig:497                                                                                                                                                                                         
  Depends on: I2C [=y] && HAS_IOMEM [=y] && GPIOLIB [=y]                                                                                                                                                                            

2. 设置使用的Pin为普通GPIO

        本例中,我使用的引脚分别是:MDIO(GPIO#22) - SDA,MDC(GPIO#23) - SCL。所以,需要先将MT7620的MDIO接口复用模式设置为普通GPIO,通过修改设备树文件,示例如下:

pinctrl {
		state_default: pinctrl0 {
			default {
				ralink,group = "pa", "spi refclk", "wdt", "uartf", "nd_sd", "mdio", "i2c";
				ralink,function = "gpio";
			};
		};
		
		i2c_pins: i2c_pins {
			i2c_pins {
					ralink,group = "i2c";
					ralink,function = "i2c";
			};
		};
	};

        注意:ralink,group里面要加入mdio,表示将mdio作为普通GPIO使用。

3. 编写设备树描述i2c-gpio设备

        使用的GPIO以上有说明,这里直接给出示例,如下

i2c-gpio {
		compatible = "i2c-gpio";
		gpios = <&gpio0 22 0 /* sda */
			&gpio0 23 0 /* scl */
		>;
		i2c-gpio,sda-open-drain;
		i2c-gpio,scl-open-drain;
		i2c-gpio,delay-us = <2>;    /* ~100 kHz */
		#address-cells = <1>;
		#size-cells = <0>;

		oled {
			compatible = "oled0.98";
			reg = <0x3c>;
		};
	};

gpios:表示SDA和SCL分别使用什么GPIO。

i2c-gpio,sda-open-drain:SDA引脚设置为开漏极

i2c-gpio,scl-open-drain:SCL引脚设置为开漏极

i2c-gpio,delay-us:指定I2C接口速率。  

oled:表示该总线下挂的设备,0.98寸的oled。

设备树编写可以参考linux-3.18.45/Documentation/devicetree/bindings/i2c/i2c-gpio.txt。

4. 编写驱动

        驱动程序直接使用前面博客使用的驱动,示例如下:

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/fs.h>
 
static int major;
static struct class *class;
static struct i2c_client *at24c02_client; 
	
ssize_t at24c02_read(struct file *file, char __user *buf, size_t size, loff_t *offset)
{
	unsigned char addr, data;
 
	copy_from_user(&addr, buf, 1);
	data = i2c_smbus_read_byte_data(at24c02_client, addr);
	copy_to_user(buf, &data, 1);
 
	return 1;
}
 
ssize_t at24c02_write(struct file *file, const char __user *buf, size_t size, loff_t *offset)
{
	unsigned char ker_buf[1024] = "";
	unsigned char addr, cmd;
	unsigned char data[1024] = ""; 
 
	copy_from_user(ker_buf, buf, size);
	cmd = ker_buf[0];
	
	if (0 == cmd) /* 0 - cmd, 1 - data */
	{
		i2c_smbus_write_byte_data(at24c02_client, 0x00, *(ker_buf + 1));
	}
	else
	{
		i2c_smbus_write_byte_data(at24c02_client, 0x40, *(ker_buf + 1));
	}
}
 
 
struct file_operations i2c_fops = {
	.owner = THIS_MODULE,
	.read  = at24c02_read,
	.write = at24c02_write, 
};
 
static int i2c_drv_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
	printk("i2c client %s, id %ld probed\n", client->name, id->driver_data);
	at24c02_client = client;
	
	major = register_chrdev(0, "at24c02", &i2c_fops);
	if (major > 0)
	{
		class = class_create(THIS_MODULE, "at24c02");
		if (class)
		{
			device_create(class, NULL, MKDEV(major, 0), NULL, "at24c02");
		}
	}	
	
	return 0;
}
 
static int i2c_drv_remove(struct i2c_client *client)
{
	printk("i2c client %s removed\n", client->name);
	device_destroy(class, MKDEV(major, 0));
	class_destroy(class);
	unregister_chrdev(major, "at24c02");
	return 0;
}
 
static const struct i2c_device_id i2c_dev_id[] = {
	{ "oled0.98", 0x3c },
	{ },
};
 
 
static struct i2c_driver i2c_drv = {
	.probe		= i2c_drv_probe,
	.remove		= i2c_drv_remove,
	.id_table	= i2c_dev_id,
	.driver 	= {
		.name = "oled",
		.owner = THIS_MODULE,
	},
};
		
static int i2c_driver_init(void)
{
	i2c_add_driver(&i2c_drv);
 
    return 0;
}
 
 
void i2c_driver_exit(void)
{
	i2c_del_driver(&i2c_drv);
		
    return;
}
 
module_init(i2c_driver_init);
module_exit(i2c_driver_exit);
MODULE_LICENSE("GPL");
 

5. 测试程序

        测试程序也参考之前写的博客,如下:

#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
 
 
#define OLED_WRITE_ADDR    0x78
#define SSD1306_WIDTH  128
#define SSD1306_HEIGHT 64
#define WRITE_CMD      			 0X00
#define WRITE_DATA     			 0X40
 
#define CONTROL_TYPE    0x00
 
#define I2C_OLED_MASTER_NUM             I2C_NUM_0
 
 
#define WRITE_BIT                          I2C_MASTER_WRITE /*!< I2C master write */
#define READ_BIT                           I2C_MASTER_READ  /*!< I2C master read */
#define ACK_CHECK_EN                       0x1              /*!< I2C master will check ack from slave*/
#define ACK_CHECK_DIS                      0x0              /*!< I2C master will not check ack from slave */
#define ACK_VAL                            0x0              /*!< I2C ack value */
#define NACK_VAL                           0x1              /*!< I2C nack value */
 
 
#define I2C_OLED_MASTER_SCL_IO          22             
#define I2C_OLED_MASTER_SDA_IO          21  
 
static uint8_t g_oled_buffer1[SSD1306_WIDTH * SSD1306_HEIGHT / 8] = {0};
 
uint8_t g_oled_buffer2[SSD1306_WIDTH * SSD1306_HEIGHT / 8] = {0};
 
static uint8_t s1[SSD1306_WIDTH * SSD1306_HEIGHT / 8] = 
{
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,
    0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF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0x06,0x06,
    0x0F,0x0F,0x0D,0x1D,0x78,0x3B,0x37,0x7F,0xE7,0xCF,0xCF,0x1F,0x3F,0x7F,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0x1F,0x87,0xE3,0xF1,0xF9,0x3C,0x1C,0x0F,0x0F,0x0F,0x03,0x01,
    0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x07,0x03,0x03,0x03,0x3F,0xFE,0xFC,0xF0,0xC1,0x07,0x1F,0xFF,0x03,0x01,0xFB,0xFE,
    0xFE,0xCF,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0xCF,0xFF,0xFF,0x7F,0x00,0x81,0xFF,
    0xFF,0xFF,0x7F,0x3F,0x00,0xCF,0xDF,0xFF,0xFD,0xF0,0xE0,0xE0,0x80,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,
    0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x1E,0x7F,0xFF,0xF3,0xE0,0xE8,0xFE,0xEF,0x9C,0x3C,0x31,0x73,
    0x67,0x6F,0x4E,0x4F,0x58,0x18,0xB0,0xB0,0xB0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,
    0xC0,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xE0,0xC0,0xC0,0x40,0x60,0x60,0x60,
    0x60,0x30,0x30,0xB0,0xFC,0xB8,0xDC,0xCE,0xEF,0xE7,0xF3,0xF9,0xFD,0xFC,0xFF,0xFF,
    0xFF,0xE0,0xC0,0xCF,0xDF,0xDF,0xD9,0xD8,0xD9,0xDD,0xCF,0xE7,0xE3,0xF1,0xFB,0xFB,
    0xFA,0xFA,0xEE,0xC6,0xDE,0xDE,0xDC,0xD4,0xDC,0xDC,0xDC,0xCE,0xE6,0xE6,0xE7,0x87,
    0x1F,0x3F,0xFF,0xFF,0xF7,0xC7,0xC3,0xC3,0xC3,0xC3,0xC3,0x43,0x63,0x73,0x73,0xF3,
    0x63,0x63,0x63,0x23,0x23,0x23,0x31,0x31,0x31,0x31,0x71,0x31,0xF1,0xF1,0xD1,0xB1,
    0xF1,0xF1,0xFB,0x1F,0x19,0xD9,0xDF,0xDB,0x19,0x09,0x8B,0xFA,0xFC,0x7C,0x1C,0x00,
    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x80,0xF8,0xFF,0x7F,0x1F,0x01,0xF0,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xF0,0x00,0x37,0x7F,0x7F,0x78,0x00,0x00,0x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3,0x79,0x7D,0x3C,0x2E,0x06,0x07,0x07,0x03,
    0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x03,0x01,
    0x03,0x03,0x8F,0x8E,0xFE,0xFC,0xF1,0x53,0x07,0xFF,0xFF,0xFF,0x03,0x01,0xFA,0xFE,
    0xFE,0xCF,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC7,0xFF,0xFF,0x7F,0x20,0x81,0xFF,
    0xFF,0xFF,0xFF,0x40,0x00,0xFF,0xFF,0xF9,0xE0,0xC0,0xC0,0x40,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,
    0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x18,0x1C,0x7F,0x7F,0xF7,0xF1,0xE1,0xEF,0xEF,0xEF,0x9C,0x3C,0x31,0x73,
    0x67,0x6F,0x4E,0x4E,0xD8,0x98,0xF0,0xF0,0xB0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,
    0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0xE0,0xC0,0xC0,0x40,0x60,0x60,0x60,
    0x60,0x30,0x30,0xB0,0xBC,0xB8,0xDC,0xCE,0xEF,0xE7,0xF3,0xF9,0xFF,0xFC,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xF8,0xEF,0xCF,0xDF,0xDF,0xD9,0xD9,0xFF,0xDF,0xCF,0xC3,0xF7,0xF6,
    0xF7,0xF6,0xE6,0xE4,0xCC,0xDC,0x9C,0x9C,0xBC,0xBC,0xBC,0x9E,0x8E,0xCE,0xE7,0x83,
    0x1F,0x3F,0xFF,0xFF,0xF6,0x4F,0xC3,0xC3,0xC3,0xC3,0xC3,0x43,0x63,0x73,0x73,0xE3,
    0x63,0x63,0x63,0x23,0x23,0x23,0x31,0x31,0x31,0x31,0x71,0x31,0xF1,0xF1,0xD1,0xB1,
    0xF1,0xF1,0xD9,0x1F,0x19,0xD9,0xD9,0xDB,0x19,0x09,0x8B,0xF8,0xFC,0x7C,0x18,0x00,
    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x80,0xF8,0xFF,0x7F,0x1F,0x01,0xF0,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0x70,0x00,0x17,0x7F,0x7F,0xF8,0x00,0x00,0x0C,0x1F,0xFF,0xFF,0xC1,0x01,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x7F,0x7F,
    0x0F,0x0F,0xFF,0x7E,0x70,0x01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xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0xCF,0x87,0xF1,0xF9,0x7C,0x1C,0x0E,
    0x1E,0x07,0x83,0x83,0xF7,0xFF,0x7E,0x1E,0xC0,0xE1,0xFB,0x79,0x39,0x1D,0x0C,0x06,
    0xC6,0xF6,0xFE,0x7C,0x19,0x81,0xE3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xCB,0xCB,0x99,0x9D,0xBD,0xBD,0x35,0x25,0x65,0x65,0x65,0x6D,0x6D,0x6C,
    0xEC,0xCC,0xF9,0x79,0x3B,0x3B,0x1B,0x0F,0x0F,0x0E,0x06,0x06,0x42,0xC3,0x83,0x83,
    0xA3,0xE3,0xC1,0xC1,0x41,0x61,0x61,0x71,0x63,0x23,0x21,0x23,0x01,0x01,0x01,0x01,
    0x03,0x09,0x09,0x09,0x0D,0x0D,0x0D,0x0F,0x3D,0x07,0x07,0x07,0x03,0x02,0x06,0x86,
    0x86,0x8C,0xCD,0xF9,0x79,0x73,0x33,0x33,0x33,0x1B,0x1B,0x19,0x0D,0x0D,0x0D,0x0C,
    0x04,0x06,0x06,0x06,0x06,0x07,0x02,0x02,0x02,0x03,0x03,0x03,0x00,0x00,0x00,0x00,
    0x00,0x00,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x06,0x06,0x06,0x06,0x0F,
    0x0F,0x1D,0x19,0x39,0x32,0x77,0xF7,0xDF,0x8F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x81,0x00,0x3C,0xFF,
    0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x03,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFC,0xFE,0xCF,
    0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0xFF,0xFF,0x7E,0x00,0x83,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xFC,
    0xFB,0xF3,0xF3,0xE7,0xE6,0xCC,0xCC,0xD8,0xD8,0xB8,0x98,0xB0,0xB0,0x30,0x20,0x60,
    0xE0,0xE0,0xF0,0xE0,0x60,0x60,0x60,0x60,0x70,0x70,0x60,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x08,0x1C,0x3D,0x7F,0xF7,0xE7,
    0x8E,0x0C,0x1C,0x38,0x38,0x30,0x30,0x20,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,
    0xC0,0x80,0x80,0x80,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x80,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0x40,0x60,0x60,0x60,0x20,0x30,
    0xB0,0xB8,0x98,0xD8,0xDC,0xFE,0xE7,0xF7,0xF7,0xF8,0xF8,0xFE,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,
    0x1F,0x7F,0xFF,0xFF,0x1F,0x1F,0x3F,0x33,0x73,0xE3,0xE3,0x62,0xE2,0x66,0x46,0x4E,
    0x46,0x46,0x46,0x46,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x67,0x67,0xE7,0xE7,0xF7,
    0x67,0xE3,0xE3,0xA3,0x33,0x33,0xB1,0x31,0x39,0xF9,0xF8,0xFC,0x78,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0xE8,0xFC,0xFF,0x1F,0x01,0xE0,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,
    0x00,0x00,0x1F,0x3F,0x7F,0x22,0x00,0x00,0x02,0x3F,0xFF,0x7F,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x3F,0x7F,
    0x7C,0x33,0x7F,0x7F,0x7C,0x00,0xC4,0xFC,0x7E,0x3F,0x0F,0x01,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x78,0x7F,0x3F,0x07,0x00,0x18,0xFF,0xFF,0xFF,0xFF,0xFF,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3D,0x3D,0x81,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0x7F,0x3F,0x3F,0x9F,0xDF,0xCF,0xEF,0x67,0x67,0x37,0x33,0x13,0x1B,0x1B,0x1B,
    0x09,0x0D,0x0D,0x0D,0x0D,0x04,0x0C,0x1F,0x1F,0x1F,0x00,0x08,0x3B,0x3F,0xBF,0xFF,
    0xCE,0xF6,0x66,0x66,0x76,0x36,0x3C,0x1C,0x1C,0x1F,0x0F,0x0C,0x0C,0x0C,0x07,0x07,
    0x07,0x06,0x0E,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,
    0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x06,0x06,0x06,0x06,0x0F,0x0F,0x1F,
    0x1D,0x3D,0x70,0x72,0xF7,0xCF,0xCF,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,0x01,
    0xFC,0xFE,0xFF,0x37,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x28,0xFC,0xFE,0x9E,0x0F,0x0F,0x89,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF0,
    0xE7,0xC7,0x9F,0x9F,0xF8,0xB0,0xF0,0xE0,0xE0,0xF0,0xC0,0xE0,0x80,0x80,0x80,0x80,
    0x80,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x07,0x0F,0x0F,
    0x1C,0x18,0x38,0x30,0xB0,0xA0,0xE0,0xF8,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,
    0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0xC0,0xF0,0xC0,0xC0,0xC0,0x60,0x70,0x70,0x60,0x60,0x30,0xB0,0xB0,0x98,
    0x98,0xDC,0xCC,0xCE,0xE7,0xF3,0xF1,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0x3F,0x01,0xC8,0xFC,0xFF,0x3F,0x1F,0x3F,0x39,0xF1,0xE1,0x63,0xC3,0xCF,0xCF,
    0xCD,0x8D,0x8D,0x89,0x89,0x89,0x89,0x89,0x89,0x89,0x8B,0x88,0x88,0x8C,0xCC,0xCC,
    0xCC,0xC4,0xE6,0xE6,0xE6,0xF3,0x73,0xB1,0xFD,0xF9,0xFB,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x60,0xFC,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0x3F,0x00,0x10,0x7F,0x7F,0x79,0x00,0x00,0x00,0x87,0xFF,0x7F,0x70,0x40,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,
    0xFF,0x7F,0xFE,0xFF,0xFF,0x17,0xE0,0x7F,0x7F,0x1F,0x07,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x33,0x3F,0x7F,0x0F,0x00,0x18,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x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0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0x7F,0x3F,0x9F,0xDF,0xDF,0xCF,0xEF,0x67,0x67,0x37,0x33,0x13,0x1B,
    0x3B,0x3B,0x09,0x0D,0x0D,0x0D,0x0D,0x05,0x04,0x3E,0x3E,0x3E,0x0F,0x0F,0xE6,0xE3,
    0xF3,0xF1,0x79,0x7C,0x7C,0x3E,0x3F,0x1F,0x1F,0x1C,0x0C,0x0D,0x0D,0x04,0x04,0x06,
    0x06,0x06,0x0E,0x0A,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,
    0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x06,0x06,0x06,0x06,0x0F,0x0F,0x1F,
    0x1D,0x3D,0x70,0x72,0xF7,0xCF,0xCF,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0x0D,0x09,0xFC,0xFF,0xFF,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x28,0xFC,0xFE,0x9F,0x0F,0x0F,0x09,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xF8,0xF0,0xE3,0xCF,0x1F,0x1E,0xB8,0xF0,0xF0,0x60,0x60,0xC0,0xC0,0xC0,0x80,0x80,
    0xC0,0xC0,0x80,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x07,0x07,0x03,0x07,0x0F,0x0C,
    0x1C,0x18,0x38,0x30,0x30,0xA0,0xE8,0xF8,0xE0,0xE0,0xC0,0xC0,0xF0,0xE0,0xC0,0x80,
    0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0xC0,0xF0,0xC0,0xC0,0xC0,0x60,0x70,0x70,0x70,0x60,0x30,0xB0,0xB0,0x98,
    0x98,0xFC,0xCC,0xCE,0xE7,0xF3,0xF1,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0x3F,0x0D,0xC8,0xFC,0xFF,0x3F,0x3F,0x3F,0x39,0xF1,0xE1,0x63,0xC3,0xCF,0xCE,
    0xCD,0x8D,0x8D,0x89,0x89,0x89,0x89,0x89,0x89,0x89,0x89,0x89,0x89,0x8C,0xCC,0xCC,
    0xCC,0xC4,0xE6,0xE6,0xE6,0xF3,0x73,0xB1,0xFD,0xFD,0xFB,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0xE0,0xFC,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0x3F,0x00,0x30,0x7F,0xFF,0x79,0x00,0x00,0x80,0x87,0xFF,0x7F,0xF0,0xC0,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,
    0xFF,0x7F,0x7E,0xFF,0xFF,0xF7,0xE0,0xFF,0x7F,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x37,0x3F,0x3F,0x1F,0x00,0x18,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0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C,0x0F,0x0F,0x07,0x06,0x0E,0xC3,0x83,0x83,
    0x83,0xE3,0xC1,0xC1,0x41,0x61,0x61,0x71,0x63,0x21,0x21,0x21,0x01,0x01,0x03,0x01,
    0x03,0x09,0x09,0x09,0x0D,0x0D,0x0D,0x0F,0x3D,0x07,0x07,0x07,0x03,0x02,0x06,0x87,
    0x86,0x8C,0xCD,0xF9,0x79,0x73,0x33,0x33,0x33,0x1B,0x1B,0x19,0x0D,0x0D,0x0D,0x0E,
    0x04,0x06,0x07,0x06,0x06,0x07,0x02,0x02,0x02,0x03,0x03,0x03,0x00,0x00,0x00,0x00,
    0x00,0x00,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x06,0x06,0x06,0x06,0x0F,
    0x0F,0x1D,0x39,0x39,0x32,0x77,0xF7,0xDF,0x8F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x81,0x00,0x3C,0xFF,
    0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x03,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFC,0xFE,0xCF,
    0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0xFF,0xFF,0x7E,0x00,0x83,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xFC,
    0xFB,0xF3,0xF3,0xE7,0xE6,0xCC,0xCC,0xD8,0xD8,0xB8,0xB8,0xB0,0xB0,0x30,0x20,0x60,
    0xE0,0xE0,0xF0,0xF0,0x60,0x60,0x60,0x60,0x70,0x70,0x60,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x08,0x1C,0x3E,0x7F,0xF7,0xE7,
    0x8E,0x0C,0x1C,0x18,0x38,0x30,0x30,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,
    0xC0,0x80,0x80,0x80,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x80,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0x40,0x78,0x60,0x60,0x20,0x30,
    0xB0,0xB8,0x98,0xD8,0xCC,0xEE,0xE7,0xF7,0xF3,0xF8,0xF8,0xFE,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,
    0x1F,0x7F,0xFF,0xFF,0x1F,0x1F,0x3F,0x33,0x73,0xE3,0xE3,0x63,0xE3,0x66,0x46,0x4E,
    0x46,0x46,0x46,0x46,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x67,0x67,0xE7,0xE7,0xF7,
    0x67,0xE3,0xE3,0xA3,0x33,0x33,0xB1,0x31,0x39,0xF9,0xF8,0xFC,0x78,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0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0xF8,
    0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,
    0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
    0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
    0xF0,0xF0,0xF0,0xF0,0xF0,0xF8,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 
};
 
static uint8_t g_oled_buffer[6][SSD1306_WIDTH * SSD1306_HEIGHT / 8];
 
int i2c_fd = 0;
 
char addr = 0x78;
 
 
int i2c_init(void)
{
    i2c_fd = open("/dev/at24c02", O_RDWR);
    if (i2c_fd < 0)
    {
		return -1;
    }
}
 
int oled_read_cmd(uint8_t *data)
{
    return read(i2c_fd, data, 1);
}
 
int oled_write_cmd(uint8_t data)
{
	char buf[2] = "";
 
	buf[0] = 0x00;
	buf[1] = data;
 
    return write(i2c_fd, buf, 2);
}
 
int oled_write_data(uint8_t data)
{
	char buf[2] = "";
 
	buf[0] = 0x01;
	buf[1] = data;
 
    return write(i2c_fd, buf, 2);
}
 
 
int oled_write_long_data(uint8_t *data, uint16_t len)
{
	int i;
 
	for (i = 0; i < len; i++)
	{
		oled_write_data(*(data + i));
	}
 
	return 0;
}
 
 
void oled_update_screen(uint8_t *buffer)
{
    uint8_t line_index;
    for(line_index=0    ;   line_index<8   ;  line_index++)
    {
        oled_write_cmd(0xb0+line_index);
        oled_write_cmd(0x00);
        oled_write_cmd(0x10);
 
        oled_write_long_data(&buffer[SSD1306_WIDTH * line_index],SSD1306_WIDTH);
    }
}
 
void oled_update_screen1(void)
{
    uint8_t line_index;
    for(line_index=0; line_index<8; line_index++)
    {
        oled_write_cmd(0xb0+line_index);
        oled_write_cmd(0x00);
        oled_write_cmd(0x10);
 
        oled_write_long_data(&g_oled_buffer1[SSD1306_WIDTH * line_index],SSD1306_WIDTH);
    }
}
 
void oled_clear(void)
{
    //清0缓存
    memset(g_oled_buffer1,0x00,sizeof(g_oled_buffer1));
    oled_update_screen1();
}
 
int oled_init(void)
{
    oled_write_cmd(0xAE);
    oled_write_cmd(0XD5);
    oled_write_cmd(0X80);
    oled_write_cmd(0XA8);
    oled_write_cmd(0X3F);
    oled_write_cmd(0XD3);
    oled_write_cmd(0X00);
    oled_write_cmd(0X40);
    oled_write_cmd(0XA1);
    oled_write_cmd(0XC8);
    oled_write_cmd(0XDA);
    oled_write_cmd(0X12);
    oled_write_cmd(0X81);
    oled_write_cmd(0XCF);
    oled_write_cmd(0XD9);
    oled_write_cmd(0XF1);
    oled_write_cmd(0XDB);
    oled_write_cmd(0X30);
    oled_write_cmd(0xA4);
    oled_write_cmd(0xA6);
    oled_write_cmd(0x8D);
    oled_write_cmd(0x14);
    oled_write_cmd(0xAF);
 
    oled_clear();
 
    return 0;
}
 
int main(int argc, char *argv[])
{
    uint8_t data = 0;
    uint32_t i = 0;
 
    memcpy(g_oled_buffer[0], s1, sizeof(s1));
    memcpy(g_oled_buffer[1], s2, sizeof(s2));
    memcpy(g_oled_buffer[2], s3, sizeof(s3));
    memcpy(g_oled_buffer[3], s4, sizeof(s4));
    memcpy(g_oled_buffer[4], s5, sizeof(s5));
    memcpy(g_oled_buffer[5], s6, sizeof(s6));
 
    i2c_init();
    oled_init();
 
    for (i = 0; i < SSD1306_WIDTH * SSD1306_HEIGHT / 8; i++)
    {
        g_oled_buffer2[i] = g_oled_buffer[i*8];
    }
 
    while(1)
    {
        for (i = 0; i < 6; i++)
        {
            oled_update_screen(g_oled_buffer[i]);
        }
    }
}

6. 效果

 

三. 总结

        本文讲解了如何开启并配置内核和设备树,使内核支持GPIO模拟I2C总线的实验。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/590494.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

模特信息管理系统的开发与实现(ASP.NET,SQLServer)

需求分析 模特信息管理系统主要给商家和模特用户提供服务&#xff0c;系统分为前台和后台两部分。 本研究课题重点主要包括&#xff1a;活动管理&#xff0c;商家管理&#xff0c;模特管理&#xff0c;系统公告管理和活动报名管理。 活动管理模块主要实现活动更新、活动添加、活…

生鲜农产品冷链物流配送路径优化模型构建及算法实现

摘要&#xff1a;本案例讲述的案例为生鲜农产品冷链物流配送路径优化&#xff0c;涉及的目标函数成本包括碳排放成本、固定成本、运输成本、货损变质成本、时间惩罚成本。 目标种类&#xff1a;单目标模型。 求解方法&#xff1a;基础版蚁群算法改进版蚁群算法。 整体对标层…

快速掌握EasyExcel在web场景中的应用(读和写)

目录 一、引入依赖 二、设置表头 三、web下载模板 四、测试下载功能 五、复杂表头 六、写入数据 七、格式优化 7.1 日期自定义转换 7.2 列宽行高注解 八、动态表头 九、动态表格写入数据 一、引入依赖 <dependency><groupId>com.alibaba</groupId>…

Linux——生产者消费者模型和信号量

目录​​​​​​​ 基于BlockingQueue的生产者消费者模型 概念 条件变量的第二个参数的作用 锁的作用 生产者消费者模型的高效性 生产者而言&#xff0c;向blockqueue里面放置任务 消费者而言&#xff0c;从blockqueue里面拿取任务&#xff1a; 总结 完整代码(不含存储…

从零开始搭建一个moveit2简单机械臂模型

文章目录 前言一、设计一个简单机械臂二、构造创建文件关系CMakeLists.txt 修改增加如下&#xff1a;package.xml 修改增加如下&#xff1a;urdf.rviz 全文如下&#xff1a;demo.launch.py 全文如下&#xff1a; launch rviz构造link构造joint 总结 前言 在网上搜了许多文章&a…

游戏互动,用Python点燃【儿童节】的欢乐!

当孩子们踏入人生的旅途时&#xff0c;他们需要的并不仅仅是学习知识&#xff0c;更需要的是在快乐的氛围中成长。六一儿童节即将来临&#xff0c;让我们用Python代码为孩子们送去一份特别的礼物吧&#xff01; 在本篇文章中&#xff0c;我会带领大家一起探索如何利用Python代…

php中文字符串提取方法,preg_replace 和preg_match_all区别

在php中&#xff0c;可以利用以下两种函数来只提取字符串的中文字符 preg_replace()函数 preg_match_all()函数 方法1&#xff1a;使用preg_match_all()函数 preg_match_all()函数配合正则表达式“/[\x{4e00}-\x{9fff}]/u”可以过滤字符串&#xff0c;只获取中文字符。 会…

chatgpt赋能python:Python中[:3]的用法介绍

Python中[:3]的用法介绍 Python是一种高级编程语言&#xff0c;经常被用于数据科学、机器学习、人工智能和Web应用程序开发。在Python中&#xff0c;有许多有用的编程技巧和语法&#xff0c;其中之一就是[:3]。 什么是[:3]&#xff1f; 在Python中&#xff0c;[:3]是一种称为…

研发工程师玩转Kubernetes——使用Ingress进行路由

依据微服务理念&#xff0c;我们希望每个独立的功能由一个服务支持。比如有两个接口&#xff1a;http://www.xxx.com/plus和http://www.xxx.com/minus&#xff0c;前者由一个叫plus-service的服务支持&#xff0c;后者由一个叫minus-service的服务支持。这样就需要一个路由层&a…

华为OD机试真题B卷 Java 实现【查找两个字符串a,b中的最长公共子串】,附详细解题思路

一、题目描述 查找两个字符串a,b中的最长公共子串。若有多个,输出在较短串中最先出现的那个。 注:子串的定义:将一个字符串删去前缀和后缀(也可以不删)形成的字符串。请和“子序列”的概念分开! 数据范围:字符串长度1≤length≤300 。 二、输入描述 输入两个字符串…

牛客网刷题学习SQL(五)

SQL25 查找山东大学或者性别为男生的信息 分析&#xff1a; 查看学校为山东大学或者性别为男性的用户的device_id、gender、age和gpa数据&#xff0c;结果不去重。 山东大学 --》 where university“山东大学” 男性—》where gender “male” 结果不去重 所以上面不能使用or&…

改进的yolo目标检测(yolo创新与改进)

目标检测是计算机视觉领域中的一个重要问题,它需要从图像或视频中检测出物体的位置和类别。近年来,深度学习技术在目标检测领域取得了显著的进展,其中一个重要的方法是基于YOLO(You Only Look Once)算法的目标检测。 YOLO算法的优点是速度快,但是在检测小物体和密集物体…

SAP-MM-发票-采购附加成本处理简介

一&#xff0e;采购附加成本处理&#xff1a; 原材料的采购成本包括采购成本&#xff08;采购单价*采购数量&#xff09;和相关采购附加成本&#xff08;运输费、保险费、报关费、仓储费、滞期费、租船费、码头费及代理费等费用&#xff09;&#xff0c;对于采购附加成本主要有…

覆盖标准(白盒、黑盒和灰盒)

覆盖标准(白盒、黑盒和灰盒) 覆盖标准Coverage Criteria 覆盖标准采用软件的抽象表示并将其划分为可测试的功能。 每个功能构成了测试需求的基础——需要由软件的测试套件进行测试的东西。 当测试套件的一个测试用例满足测试要求时&#xff0c;我们说测试要求被覆盖。测试套件…

四、机器人整体结构的稳定性

结构的稳定性是指结构在外界载荷作用下&#xff0c;能否维持自己的形状和位置。如果结构在外界载荷作用下能够维持自己的形状和位置&#xff0c;则称为稳定&#xff1b;如果结构在外界载荷作用下无法维持自己的形状和位置&#xff0c;则称为不稳定。 结构的稳定性是一个相对概念…

管理系统总结(前端:Vue-cli, 后端Jdbc连接mysql数据库,项目部署tomcat里)

根据所学的知识, 写一个管理系统, 顺便总结一些知识点 准备: 前端用vue-cli的框架, 后端用jdbc连接数据库, 项目部署tomcat服务器来完成交互 ●前端的vue-cli框架搭建可以看 点击跳转 的第二小结 ●后端的tomcat在idea里的相关的配置与集成,可以看 点击跳跃 文章目录 一、 前段…

机智云物联网低功耗转接板GE211+机智云APP遥控灯

要实现硬件的智能化&#xff0c;除了硬件本身外&#xff0c;还需要实现&#xff1a;智能云平台、手机 APP、联网模块&#xff0c;每 一个领域都需要专业的团队来支撑。机智云提供完整的解决方案&#xff0c;让厂商或开发者只需要专 注于自身产品硬件。以最小的成本和风险实现硬…

【网络】路由器和无线路由器就这么配置

目录 &#x1f352;常见的接入互联网方式 &#x1f353;WAN配置 &#x1f353;LAN口配置 &#x1f353;WLAN配置 &#x1f353;WLAN安全 &#x1f352;路由设备管理 &#x1f353;路由器内部组件 &#x1f353;Cisco路由器的启动过程 &#x1f353;基础命令 &#x1f34e;show …

数据库中的DDL、DQL、DML、DCL 和 TCL 命令

数据库中的DDL、DQL、DML、DCL 和 TCL 命令 SQLDDL&#xff08;Data Definition Language&#xff09;数据库定义语言DML&#xff08;Data Manipulation Language&#xff09;数据操纵语言TCL&#xff08;Transaction Control Language&#xff09;事务控制语言DQL (Data Query…

UEFI开发环境搭建(Windows)

重拾UEFI学习。 第一步是搭建开发环境&#xff0c;记录如下&#xff1a; 1. 安装开发工具 Visual Studio 2017 python/ASL/NASM 安装到如下目录&#xff1a; c:\Python310 c:\ASL c:\NASM 更新系统变量Path: 新建系统变量PYTHON_HOME 下载EDK2 创建工作目录&#xff…