user11876: I need faster communication between the ESP and the ADC, so I found this
https://github.com/pasko-zh/brzo_i2c.
Original wire Example
#include "Wire.h"
#define PCF8591 0x48
byte a0;

void setup() {
  Wire.begin(13, 14);
  Serial.begin(115200);
}

void loop() {
  Wire.beginTransmission(PCF8591);
  Wire.write(0x04);
  Wire.endTransmission();
  Wire.requestFrom(PCF8591, 5);

  a0 = Wire.read();
  a0 = Wire.read();

  Serial.println(a0);
  delay(1000);
}

Brzo I2C example 
#include "brzo_i2c.h"

uint8_t buffer[10];
uint8_t error = 0;
float temp = 0.0;

uint8_t ICACHE_RAM_ATTR get_temp(float *t) {
  uint8_t bcode = 0;
  brzo_i2c_start_transaction(0x48, 400);
  buffer[0] = 0x04;
  brzo_i2c_write(buffer, 1, false);
  brzo_i2c_read(buffer, 2, false);
  bcode = brzo_i2c_end_transaction();
  *t = ((buffer[0] << 8) | buffer[1]);
  return bcode;
}

void setup() {
  delay(500);
  Serial.begin(115200);
  brzo_i2c_setup(13, 14, 2000);
}

void loop() {
  error = get_temp(&temp);
  if (error == 0) {
    Serial.print("Temp = ");
    Serial.println(temp, 8);
  } else {
    Serial.print("Brzo error : ");
    Serial.println(error);
  }
  delay(500);
}

But I get always the same error.

1 : Bus not free

I rewrote it in different ways, changing the frequency, pins and doing multiple transactions. The main reason I don't get it to work is the difference in the API.
There is no Wire.requestFrom(); in the brzo_i2c lib. So I need to read the value with brzo_i2c_read(buffer,2,false);.

user10394: I have no idea about Brzo but this looks wrong:
 brzo_i2c_start_transaction(0x48,400);
 buffer[0]=0x04; 
 brzo_i2c_write(buffer,1,false);       // Write
 brzo_i2c_read(buffer,2,false);        // Then a read ??
 bcode=brzo_i2c_end_transaction();    

I think you end and read are the wrong way round, but like I say I've never done anything with this so I'm probably wrong.

user21371: This line
brzo_i2c_start_transaction(0x48,400);

Sets the SCL frequency to 400kHz.
According to the Datasheet for the PCF8591 the maximum SCL clock frequency is 100kHz.
The other issue may be the "repeated_start" flag on brzo_i2c_write.
If you look at the examples, and "apply" that to your code, your would do something like:
uint8_t ICACHE_RAM_ATTR get_temp(float *t){
  uint8_t bcode=0;
  brzo_i2c_start_transaction(0x48,100); // changed 400 to 100
  buffer[0]=0x04; 
  brzo_i2c_write(buffer,1,true); // changed to true because 
  brzo_i2c_read(buffer,2,false);
  bcode=brzo_i2c_end_transaction();
  *t=((buffer[0]<<8)|buffer[1]);
  return bcode;
}

My understanding of the code is that you would set repeated_start to true in the write if you want to then immediately read - which in your case you want to.

11876: <p>I need faster communication between the ESP and the ADC, so I found this
<a href="https://github.com/pasko-zh/brzo_i2c" rel="nofollow noreferrer">https://github.com/pasko-zh/brzo_i2c</a>.</p>

<p><strong>Original wire Example</strong></p>

<pre><code>#include "Wire.h"
#define PCF8591 0x48
byte a0;

void setup() {
  Wire.begin(13, 14);
  Serial.begin(115200);
}

void loop() {
  Wire.beginTransmission(PCF8591);
  Wire.write(0x04);
  Wire.endTransmission();
  Wire.requestFrom(PCF8591, 5);

  a0 = Wire.read();
  a0 = Wire.read();

  Serial.println(a0);
  delay(1000);
}
</code></pre>

<p><strong>Brzo I2C example</strong> </p>

<pre><code>#include "brzo_i2c.h"

uint8_t buffer[10];
uint8_t error = 0;
float temp = 0.0;

uint8_t ICACHE_RAM_ATTR get_temp(float *t) {
  uint8_t bcode = 0;
  brzo_i2c_start_transaction(0x48, 400);
  buffer[0] = 0x04;
  brzo_i2c_write(buffer, 1, false);
  brzo_i2c_read(buffer, 2, false);
  bcode = brzo_i2c_end_transaction();
  *t = ((buffer[0] &lt;&lt; 8) | buffer[1]);
  return bcode;
}

void setup() {
  delay(500);
  Serial.begin(115200);
  brzo_i2c_setup(13, 14, 2000);
}

void loop() {
  error = get_temp(&amp;temp);
  if (error == 0) {
    Serial.print("Temp = ");
    Serial.println(temp, 8);
  } else {
    Serial.print("Brzo error : ");
    Serial.println(error);
  }
  delay(500);
}
</code></pre>

<p>But I get always the same error.</p>

<blockquote>
  <p>1 : Bus not free</p>
</blockquote>

<p>I rewrote it in different ways, changing the frequency, pins and doing multiple transactions. The main reason I don't get it to work is the difference in the API.</p>

<p>There is no <code>Wire.requestFrom();</code> in the brzo_i2c lib. So I need to read the value with <code>brzo_i2c_read(buffer,2,false);</code>.</p>
 10394: <p>I have no idea about Brzo but this looks wrong:</p>

<pre><code> brzo_i2c_start_transaction(0x48,400);
 buffer[0]=0x04; 
 brzo_i2c_write(buffer,1,false);       // Write
 brzo_i2c_read(buffer,2,false);        // Then a read ??
 bcode=brzo_i2c_end_transaction();    
</code></pre>

<p>I think you end and read are the wrong way round, but like I say I've never done anything with this so I'm probably wrong.</p>
 21371: <p>This line</p>

<pre><code>brzo_i2c_start_transaction(0x48,400);
</code></pre>

<p>Sets the SCL frequency to 400kHz.</p>

<p>According to the <a href="https://www.nxp.com/docs/en/data-sheet/PCF8591.pdf#page=20" rel="nofollow noreferrer">Datasheet for the PCF8591</a> the maximum SCL clock frequency is 100kHz.</p>

<p>The other issue <em>may</em> be the "repeated_start" flag on <code>brzo_i2c_write</code>.</p>

<p>If you look at the examples, and "apply" that to your code, your would do something like:</p>

<pre><code>uint8_t ICACHE_RAM_ATTR get_temp(float *t){
  uint8_t bcode=0;
  brzo_i2c_start_transaction(0x48,100); // changed 400 to 100
  buffer[0]=0x04; 
  brzo_i2c_write(buffer,1,true); // changed to true because 
  brzo_i2c_read(buffer,2,false);
  bcode=brzo_i2c_end_transaction();
  *t=((buffer[0]&lt;&lt;8)|buffer[1]);
  return bcode;
}
</code></pre>

<p>My understanding of the code is that you would set <code>repeated_start</code> to true in the write if you want to then immediately read - which in your case you want to.</p>
