blob: c452ee7adbeeb70afe82e7d7b7bcc28b8dd59e4e [file] [log] [blame]
Tony Lee6c595012019-06-19 10:54:59 +08001#pragma once
2
3#include <errno.h>
4#include <fcntl.h>
5#include <stdint.h>
6#include <stdio.h>
7#include <stdlib.h>
8#include <string.h>
9#include <sys/ioctl.h>
10#include <unistd.h>
11
12namespace phosphor
13{
14namespace smbus
15{
16
17class Smbus
18{
19 public:
20 Smbus(){};
21
22 int openI2cDev(int i2cbus, char* filename, size_t size, int quiet);
23
24 int smbusInit(int smbus_num);
25
26 void smbusClose(int smbus_num);
27
George Hung92a15ba2020-09-14 17:14:52 +080028 int SendSmbusRWCmdRAW(int smbus_num, int8_t device_addr, uint8_t* tx_data,
29 uint8_t tx_len, uint8_t* rsp_data, uint8_t rx_len);
Tony Lee6c595012019-06-19 10:54:59 +080030};
31
32} // namespace smbus
Patrick Williams7da98582023-05-10 07:50:46 -050033} // namespace phosphor