void app_main(void)
{
I2C_Init();
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
// i2c_master_start(cmd);
i2c_master_write_byte(cmd, ((0x06) << 1) | WRITE_BIT, ACK_CHECK_EN);
i2c_master_write_byte(cmd, 0x09, ACK_CHECK_EN);
i2c_master_write_byte(cmd, 0xB3, ACK_CHECK_DIS);
i2c_master_write_byte(cmd, 0x0A, ACK_CHECK_DIS);
i2c_master_write_byte(cmd, 0x05, ACK_CHECK_DIS);
i2c_master_write_byte(cmd, 0x3c, ACK_CHECK_DIS);
i2c_master_write_byte(cmd, 0x08, ACK_CHECK_DIS);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(i2c_master_port, cmd, 1000 / portTICK_RATE_MS);
i2c_cmd_link_delete(cmd);
if (ret == ESP_OK)
{
ESP_LOGI(TAG, "Write OK");
}
else if (ret == ESP_ERR_TIMEOUT)
{
ESP_LOGW(TAG, "Bus is busy");
}
else
{
ESP_LOGW(TAG, "Write Failed");
}
// vTaskDelay(1000 / portTICK_PERIOD_MS);
// I2C_Write(i2c_master_port,0x06,0x09,0xB3);
// vTaskDelay(50 / portTICK_PERIOD_MS);
// I2C_Write(i2c_master_port,0x06,0x09,0xB3);
// printf("key\n");
// I2C_Write(i2c_master_port,0x06,0x0A,0x05);
// printf("programe\n");
// // I2C_Write(i2c_master_port,6,0x3C,0x07);
// //
}