i2c: rename read/write register functions (#22905)
This commit is contained in:
parent
e1f59a6efc
commit
a522b1f156
44 changed files with 184 additions and 170 deletions
|
@ -59,16 +59,16 @@ uint8_t init_mcp23017(void) {
|
|||
uint8_t data[2];
|
||||
data[0] = 0x0;
|
||||
data[1] = 0b00111111;
|
||||
mcp23017_status = i2c_writeReg(I2C_ADDR, I2C_IODIRA, data, 2, 50000);
|
||||
mcp23017_status = i2c_write_register(I2C_ADDR, I2C_IODIRA, data, 2, 50000);
|
||||
if (mcp23017_status) goto out;
|
||||
data[0] = 0xFFU;
|
||||
mcp23017_status = i2c_writeReg(I2C_ADDR, I2C_GPIOA, data, 1, 5000);
|
||||
mcp23017_status = i2c_write_register(I2C_ADDR, I2C_GPIOA, data, 1, 5000);
|
||||
if (mcp23017_status) goto out;
|
||||
mcp23017_status = i2c_writeReg(I2C_ADDR, I2C_GPPUB, data+1, 1, 2);
|
||||
mcp23017_status = i2c_write_register(I2C_ADDR, I2C_GPPUB, data+1, 1, 2);
|
||||
if (mcp23017_status) goto out;
|
||||
|
||||
out:
|
||||
return mcp23017_status;
|
||||
// i2c_readReg(I2C_ADDR, );
|
||||
// i2c_read_register(I2C_ADDR, );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue