support new NV14 touch controller (#2027)
* support new NV14 touch controller * implement review changes reduced CST836U read delay to 5 us
This commit is contained in:
committed by
Raphael Coeffic
parent
10c851469a
commit
42e54f5100
@@ -187,17 +187,22 @@ int stm32_i2c_write(uint8_t bus, uint16_t addr, uint16_t reg, uint16_t reg_size,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32_i2c_is_dev_ready(uint8_t bus, uint16_t addr, uint32_t timeout)
|
||||
int stm32_i2c_is_dev_ready(uint8_t bus, uint16_t addr, uint32_t retries, uint32_t timeout)
|
||||
{
|
||||
I2C_HandleTypeDef* h = get_i2c_handle(bus);
|
||||
if (!h) return -1;
|
||||
if (!h) return -1;
|
||||
|
||||
HAL_StatusTypeDef err = HAL_I2C_IsDeviceReady(h, addr << 1, (uint32_t)-1, timeout);
|
||||
HAL_StatusTypeDef err = HAL_I2C_IsDeviceReady(h, addr << 1, retries, timeout);
|
||||
if (err != HAL_OK) return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32_i2c_is_dev_ready(uint8_t bus, uint16_t addr, uint32_t timeout)
|
||||
{
|
||||
return stm32_i2c_is_dev_ready(bus, addr, 1, timeout);
|
||||
}
|
||||
|
||||
static int i2c_enable_gpio_clock(GPIO_TypeDef *GPIOx)
|
||||
{
|
||||
if (GPIOx == GPIOA)
|
||||
|
||||
@@ -51,4 +51,6 @@ int stm32_i2c_read(uint8_t bus, uint16_t addr, uint16_t reg, uint16_t reg_size,
|
||||
int stm32_i2c_write(uint8_t bus, uint16_t addr, uint16_t reg, uint16_t reg_size,
|
||||
uint8_t* data, uint16_t len, uint32_t timeout);
|
||||
|
||||
int stm32_i2c_is_dev_ready(uint8_t bus, uint16_t addr, uint32_t retries, uint32_t timeout);
|
||||
int stm32_i2c_is_dev_ready(uint8_t bus, uint16_t addr, uint32_t timeout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user