Files
Yuhao Zhou 784925cdc5 add a kernel module.
Squashed commit of the following:

commit 48ad47c2cb990c7550325e798064cfab612c3e7e
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Fri Jun 7 01:51:01 2024 +0800

    update README.md

commit 576cc1e21d629e83ac589cd7f806698814da4858
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Fri Jun 7 01:23:31 2024 +0800

    update makefiles

commit 577e2fc326df4d8edc8c303a89bde89ceca90949
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Fri Jun 7 00:29:26 2024 +0800

    change the i2c device name

commit 303a05e1f4695dcc0bc117c412b0e668dd7bb2a5
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 22:46:18 2024 +0800

    add the status attribute

commit ca1a51522b9ad28b04dc12d6012994bc6dce022c
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 22:34:33 2024 +0800

    fix including filename

commit 4684bd1aaaa0de089537686d65caee4352df3bcf
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 22:18:11 2024 +0800

    add dkms.conf

commit 4925eec10259c5c626c9459a65a7abeb115c4050
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 19:35:37 2024 +0800

    Update the manual of the kernel module

commit e07f1570efab507221092d9f2d09d6b98e32f2eb
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 16:25:30 2024 +0800

    add a netdev monitoring script

commit 813884f0bd928424b3e5be9053a7cc9289ab2263
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 15:33:28 2024 +0800

    support blink and breath

commit 991db7c11521a2b7e2f841bf5916ff58003b951a
Merge: a4e540c c3e6324
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 13:35:16 2024 +0800

    Merge branch 'master' into kmod

commit a4e540cbbde41d6a8570881a85bbfebab9def1ad
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Thu Jun 6 13:20:28 2024 +0800

    add a script of monitoring diskio

commit 5b65173ec68d2a9ebc952d120935e0f533f6760f
Author: Yuhao Zhou <miskcoo@gmail.com>
Date:   Wed Jun 5 23:26:09 2024 +0800

    add a kernel driver of leds
2024-06-07 01:51:15 +08:00

23 lines
418 B
C++

#ifndef __UGREEN_I2C_H__
#define __UGREEN_I2C_H__
#include <stdint.h>
#include <vector>
class i2c_device_t {
private:
int _fd;
public:
~i2c_device_t();
int start(const char *filename, uint16_t addr);
std::vector<uint8_t> read_block_data(uint8_t command, uint32_t size);
int write_block_data(uint8_t command, std::vector<uint8_t> data);
uint8_t read_byte_data(uint8_t command);
};
#endif