一. I2C通过设备树添加设备
通过设备可以向I2C总线添加I2C设备,设备树举例如下:
i2c: i2c@900 {
compatible = "ralink,rt2880-i2c";
reg = <0x900 0x100>;
resets = <&rstctrl 16>;
reset-names = "i2c";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2c_pins>;
oled {
compatible = "oled0.98";
reg = <0x3c>;
};
};
设备树中在I2C总线下添加了一个oled0.98设备,oled在I2C总线中的地址为0x3c。可以在/sys/bus/platform下看到这个设备。
# ls /sys/bus/platform/devices/10000900.i2c/i2c-0/0-003c/
driver modalias name subsystem uevent
# cat /sys/bus/platform/devices/10000900.i2c/i2c-0/0-003c/name
oled0.98
二. I2C驱动代码
#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");
三. I2C应用代码
#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,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x00,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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
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,0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3,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,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,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,0x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00,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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00,0x00,0x00,
0x40,0x78,0x7F,0x7F,0x07,0x04,0x18,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,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFE,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,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]);
}
}
}
以上的代码功能是首先打开oled设备,初始化oled,然后轮流显示四张图片,形成一个简单的动画。
四. 应用程序的效果
运行应用代码,oled会出现一个动画,因为四张图片轮流播放,效果如下文章来源:https://www.toymoban.com/news/detail-624414.html
文章来源地址https://www.toymoban.com/news/detail-624414.html
到了这里,关于Linux I2C驱动分析2 - 通过设备树添加设备的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!