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
|
@ -14,9 +14,9 @@ extern bool touchpad_init;
|
|||
void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) {
|
||||
uint8_t cmdByte = READ_MASK | address; // Form the READ command byte
|
||||
if (touchpad_init) {
|
||||
i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT);
|
||||
if (i2c_readReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||
pd_dprintf("error cirque_pinnacle i2c_readReg\n");
|
||||
i2c_write_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT);
|
||||
if (i2c_read_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||
pd_dprintf("error cirque_pinnacle i2c_read_register\n");
|
||||
touchpad_init = false;
|
||||
}
|
||||
i2c_stop();
|
||||
|
@ -28,8 +28,8 @@ void RAP_Write(uint8_t address, uint8_t data) {
|
|||
uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte
|
||||
|
||||
if (touchpad_init) {
|
||||
if (i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||
pd_dprintf("error cirque_pinnacle i2c_writeReg\n");
|
||||
if (i2c_write_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||
pd_dprintf("error cirque_pinnacle i2c_write_register\n");
|
||||
touchpad_init = false;
|
||||
}
|
||||
i2c_stop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue