Tony Lee | 6c59501 | 2019-06-19 10:54:59 +0800 | [diff] [blame] | 1 | #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 | |
| 12 | namespace phosphor |
| 13 | { |
| 14 | namespace smbus |
| 15 | { |
| 16 | |
| 17 | class 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 Hung | 92a15ba | 2020-09-14 17:14:52 +0800 | [diff] [blame] | 28 | 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 Lee | 6c59501 | 2019-06-19 10:54:59 +0800 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | } // namespace smbus |
| 33 | } // namespace phosphor |