Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib_i2c/api/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef interface i2c_master_if {
* device, otherwise ``I2C_NACK``.
*/
[[guarded]]
i2c_res_t write(uint8_t device_addr, uint8_t buf[n], size_t n,
i2c_res_t write(uint8_t device_addr, const uint8_t buf[n], size_t n,
REFERENCE_PARAM(size_t, num_bytes_sent), int send_stop_bit);

/** Read data from an I2C bus.
Expand Down Expand Up @@ -495,7 +495,7 @@ typedef interface i2c_master_async_if {
* the component until a stop bit has been sent.
*/
[[guarded]]
void async_master_write(uint8_t device_addr, uint8_t buf[n], size_t n,
void async_master_write(uint8_t device_addr, const uint8_t buf[n], size_t n,
int send_stop_bit);

/** Initialize a read to an I2C bus.
Expand Down
2 changes: 1 addition & 1 deletion lib_i2c/src/i2c_master.xc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void i2c_master(

case (size_t i = 0; i < n; i++)
(n == 1 || (locked_client == -1 || i == locked_client)) =>
c[i].write(uint8_t device, uint8_t buf[n], size_t n,
c[i].write(uint8_t device, const uint8_t buf[n], size_t n,
size_t &num_bytes_sent,
int send_stop_bit) -> i2c_res_t result:
unsigned fall_time = last_fall_time;
Expand Down
4 changes: 2 additions & 2 deletions lib_i2c/src/i2c_master_async.xc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void i2c_master_async_aux(

while (1) {
select {
case i[int j].write(uint8_t addr, uint8_t buf0[n], size_t n,
case i[int j].write(uint8_t addr, const uint8_t buf0[n], size_t n,
int ssb):
device_addr = addr;
send_stop_bit = ssb;
Expand Down Expand Up @@ -470,7 +470,7 @@ void i2c_master_async_comb(
}
break;

case i[int j].write(uint8_t device_addr, uint8_t buf0[n], size_t n,
case i[int j].write(uint8_t device_addr, const uint8_t buf0[n], size_t n,
int _send_stop_bit):
data = (device_addr << 1) | 0;
bitnum = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib_i2c/src/i2c_master_single_port.xc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void i2c_master_single_port(

case (size_t i = 0; i < n; i++)
(n == 1 || (locked_client == -1 || i == locked_client)) =>
c[i].write(uint8_t device, uint8_t buf[n], size_t n,
c[i].write(uint8_t device, const uint8_t buf[n], size_t n,
size_t &num_bytes_sent,
int send_stop_bit) -> i2c_res_t result:

Expand Down