add get touch coordinate function to xidatong-riscv64.
This commit is contained in:
@@ -75,8 +75,7 @@ static void SetSdaState(void* data, uint8 sda_state)
|
||||
if (sda_state) {
|
||||
gpio_set_drive_mode(bus_param->i2c_sda_pin, GPIO_DM_OUTPUT );
|
||||
gpio_set_pin(bus_param->i2c_sda_pin , GPIO_PV_HIGH );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gpio_set_drive_mode(bus_param->i2c_sda_pin, GPIO_DM_OUTPUT );
|
||||
gpio_set_pin(bus_param->i2c_sda_pin , GPIO_PV_LOW );
|
||||
}
|
||||
@@ -88,8 +87,7 @@ static void SetSclState(void* data, uint8 scl_state)
|
||||
if (scl_state) {
|
||||
gpio_set_drive_mode(bus_param->i2c_scl_pin, GPIO_DM_OUTPUT );
|
||||
gpio_set_pin(bus_param->i2c_scl_pin , GPIO_PV_HIGH );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gpio_set_drive_mode(bus_param->i2c_scl_pin, GPIO_DM_OUTPUT );
|
||||
gpio_set_pin(bus_param->i2c_scl_pin , GPIO_PV_LOW );
|
||||
}
|
||||
@@ -289,11 +287,9 @@ static x_size_t I2cSendBytes(struct I2cBus* bus, struct I2cDataStandard* msg)
|
||||
count --;
|
||||
ptr ++;
|
||||
bytes ++;
|
||||
}
|
||||
else if (ret == 0) {
|
||||
} else if (ret == 0) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
KPrintf("send bytes: error %d", ret);
|
||||
|
||||
return ret;
|
||||
@@ -333,8 +329,7 @@ static x_size_t I2cRecvBytes(struct I2cBus* bus, struct I2cDataStandard* msg)
|
||||
if (val >= 0) {
|
||||
*ptr = val;
|
||||
bytes ++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -406,8 +401,7 @@ static x_err_t I2cBitSendAddress(struct I2cBus* bus, struct I2cDataStandard* msg
|
||||
return -EPIO;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
addr1 = msg->addr << 1;
|
||||
if (flags & I2C_RD)
|
||||
addr1 |= 1;
|
||||
|
||||
Reference in New Issue
Block a user