Skip to content

Commit f5844ba

Browse files
committed
include:hw: Add i2c missing function and fix wrong API
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 594eab8 commit f5844ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

include/hw/i2c.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ extern "C" {
1111
#endif
1212

1313
/**
14-
* Initialize I2C hardwar and setup pin-mux
14+
* Initialize I2C hardware and setup pin-mux
1515
* @param speed_khz [in] I2C Speed in Khz (must be < 400)
1616
* @return 0 on success, negative value on error
1717
*/
1818
int i2c_hw_init(int speed_khz);
1919

20+
/**
21+
* Set I2C master clock speed
22+
* @param speed_khz [in] I2C Speed in Khz (must be < 400)
23+
* @return 0 on success, negative value on error
24+
*/
25+
int i2c_hw_setspeed(int speed_khz);
26+
2027
/**
2128
* Master send data over I2C slave device
2229
* Hardware FIFO only support upto 8 bytes at one time for transfer
@@ -48,7 +55,7 @@ int i2c_hw_read(unsigned char address, unsigned char *buffer, int len);
4855
* @param rdlen [in] No. of bytes to read
4956
* @return Length of data read from slave on success, negative value on error
5057
*/
51-
int i2c_hw_rw(unsigned char address, unsigned char *wrbuf, int wrlen, unsigned char *rdbuf, int rdlen);
58+
int i2c_hw_writeread(unsigned char address, unsigned char *wrbuf, int wrlen, unsigned char *rdbuf, int rdlen);
5259

5360
/**
5461
* De-Init I2C bus and release GPIO

0 commit comments

Comments
 (0)