mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-11 19:29:50 +00:00
Merge pull request #1813 from arurke/cc26xx_cc13xx_i2c_fixes
CC26xx/CC13xx fix for burst TX followed by burst RX
This commit is contained in:
commit
47265c9305
@ -174,8 +174,6 @@ board_i2c_write(uint8_t *data, uint8_t len)
|
|||||||
bool
|
bool
|
||||||
board_i2c_write_single(uint8_t data)
|
board_i2c_write_single(uint8_t data)
|
||||||
{
|
{
|
||||||
bool success;
|
|
||||||
|
|
||||||
/* Write slave address */
|
/* Write slave address */
|
||||||
ti_lib_i2c_master_slave_addr_set(I2C0_BASE, slave_addr, false);
|
ti_lib_i2c_master_slave_addr_set(I2C0_BASE, slave_addr, false);
|
||||||
|
|
||||||
@ -188,9 +186,8 @@ board_i2c_write_single(uint8_t data)
|
|||||||
/* Assert RUN + START + STOP */
|
/* Assert RUN + START + STOP */
|
||||||
ti_lib_i2c_master_control(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);
|
ti_lib_i2c_master_control(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);
|
||||||
while(ti_lib_i2c_master_busy(I2C0_BASE));
|
while(ti_lib_i2c_master_busy(I2C0_BASE));
|
||||||
success = i2c_status();
|
|
||||||
|
|
||||||
return success;
|
return i2c_status();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
bool
|
bool
|
||||||
@ -256,12 +253,11 @@ board_i2c_write_read(uint8_t *wdata, uint8_t wlen, uint8_t *rdata, uint8_t rlen)
|
|||||||
for(i = 1; i < wlen && success; i++) {
|
for(i = 1; i < wlen && success; i++) {
|
||||||
/* Write next byte */
|
/* Write next byte */
|
||||||
ti_lib_i2c_master_data_put(I2C0_BASE, wdata[i]);
|
ti_lib_i2c_master_data_put(I2C0_BASE, wdata[i]);
|
||||||
if(i < wlen - 1) {
|
|
||||||
/* Clear START */
|
/* Clear START */
|
||||||
ti_lib_i2c_master_control(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
|
ti_lib_i2c_master_control(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
|
||||||
while(ti_lib_i2c_master_busy(I2C0_BASE));
|
while(ti_lib_i2c_master_busy(I2C0_BASE));
|
||||||
success = i2c_status();
|
success = i2c_status();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!success) {
|
if(!success) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user