/* if ack == I2C_ACK, ACK the byte so can continue reading, else send I2C_NOACK to end the read.  */
static uchar i2c_gpio_read_byte(struct gpio_desc *scl, struct gpio_desc *sda, int delay, int ack)
/* if ack == I2C_ACK, ACK the byte so can continue reading, else send I2C_NOACK to end the read.  */
static uchar i2c_gpio_read_byte(struct gpio_desc *scl, struct gpio_desc *sda, int delay, int ack)
{
	int  data;
	int  j;
	i2c_gpio_sda_high(scl, sda, delay);
	data = 0;
	for (j = 0; j < 8; j++) {
		data <<= 1;
		data |= i2c_gpio_read_bit(scl, sda, delay);
	}
	i2c_gpio_send_ack(scl, sda, delay, ack);
	return data;
}