2016-05-05 12:50 PM
Hello.
I try to set up STMPE, using the bus I2C. I need to control a LED, and the high level on GPIO5 pin is for this purpose necessary. I do setup here so:data_i2c[0] = CHIP_ID_REG; //read CHIP_ID STMPE1801
HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
HAL_I2C_Master_Receive(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = VERSION_ID_REG; //read VERSION_ID STMPE1801
HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
HAL_I2C_Master_Receive(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = SYS_CTRL_REG; //reset for STMPE1801
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = 0x86;
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = GPIO_SET_DIR_LOW;
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = 0x20;
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = GPIO_PULL_UP_LOW;
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
data_i2c[0] = 0x20;
ret_value = HAL_I2C_Master_Transmit(&hi2c3, i2c_addr, data_i2c, 1, 500);
But on a pin of GPIO5 there is no high level. What do I do not so?