1.1 --- a/pkg/devices/lib/i2c/include/i2c-jz4780.h Sun Jul 21 22:23:06 2019 +0200
1.2 +++ b/pkg/devices/lib/i2c/include/i2c-jz4780.h Mon Jul 22 00:17:30 2019 +0200
1.3 @@ -52,9 +52,16 @@
1.4 uint32_t frequency);
1.5
1.6 void set_target(uint8_t addr);
1.7 +
1.8 + // Reading initiation and execution.
1.9 +
1.10 void start_read(uint8_t buf[], unsigned int total);
1.11 void read();
1.12 - void write(uint8_t buf[], unsigned int total);
1.13 +
1.14 + // Writing initiation and execution.
1.15 +
1.16 + void start_write(uint8_t buf[], unsigned int total);
1.17 + void write();
1.18
1.19 // Transaction control.
1.20
1.21 @@ -64,8 +71,11 @@
1.22 // Specific status conditions.
1.23
1.24 unsigned int have_read();
1.25 + unsigned int have_written();
1.26 int read_done();
1.27 - int read_incomplete();
1.28 + int write_done();
1.29 +
1.30 + int failed();
1.31 int read_failed();
1.32 int write_failed();
1.33
1.34 @@ -83,7 +93,7 @@
1.35
1.36 void set_read_threshold();
1.37 void queue_reads();
1.38 - void queue_writes(uint8_t buf[], unsigned int *pos, unsigned int total);
1.39 + void queue_writes();
1.40 void store_reads();
1.41 };
1.42
1.43 @@ -124,13 +134,19 @@
1.44
1.45 void jz4780_i2c_read(void *i2c_channel);
1.46
1.47 +void jz4780_i2c_start_write(void *i2c_channel, uint8_t buf[], unsigned int total);
1.48 +
1.49 +void jz4780_i2c_write(void *i2c_channel);
1.50 +
1.51 int jz4780_i2c_read_done(void *i2c_channel);
1.52
1.53 +int jz4780_i2c_write_done(void *i2c_channel);
1.54 +
1.55 unsigned int jz4780_i2c_have_read(void *i2c_channel);
1.56
1.57 -int jz4780_i2c_read_incomplete(void *i2c_channel);
1.58 +unsigned int jz4780_i2c_have_written(void *i2c_channel);
1.59
1.60 -void jz4780_i2c_write(void *i2c_channel, uint8_t buf[], unsigned int total);
1.61 +int jz4780_i2c_failed(void *i2c_channel);
1.62
1.63 void jz4780_i2c_stop(void *i2c_channel);
1.64