i2c: mraa_i2c_init_raw fixed and sub-platform updates.
mraa_i2c_init_raw now works again without platfrorm defined. More API calls now support sub-platform Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
79e33890b6
commit
b20a685b0c
@@ -306,11 +306,6 @@ mraa_ftdi_ft4222_i2c_read_byte(mraa_i2c_context dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
mraa_ftdi_ft4222_i2c_read_byte_data(mraa_i2c_context dev, uint8_t command)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
mraa_ftdi_ft4222_i2c_read_word_data(mraa_i2c_context dev, uint8_t command)
|
||||
@@ -339,6 +334,19 @@ mraa_ftdi_ft4222_i2c_write_byte(mraa_i2c_context dev, uint8_t data)
|
||||
return mraa_ftdi_ft4222_i2c_write(dev, &data, 1);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
mraa_ftdi_ft4222_i2c_read_byte_data(mraa_i2c_context dev, uint8_t command)
|
||||
{
|
||||
const uint8_t reg_addr = command;
|
||||
uint8_t data;
|
||||
if (mraa_ftdi_ft4222_i2c_write(dev, ®_addr, 1) != MRAA_SUCCESS)
|
||||
return 0;
|
||||
if (mraa_ftdi_ft4222_i2c_read(dev, &data, 1) != 1)
|
||||
return 0;
|
||||
return data;
|
||||
}
|
||||
|
||||
static mraa_result_t
|
||||
mraa_ftdi_ft4222_i2c_write_byte_data(mraa_i2c_context dev, const uint8_t data, const uint8_t command)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user