peripheralman.c: Updating GPIO, SPI, I2C bus structures for all the available buses
@@ -701,10 +701,30 @@ mraa_peripheralman_plat_init()
}
int i = 0;
+
+ //Updating GPIO bus structure
for (; i < gpios_count; i++) {
b->pins[i].name = gpios[i];
b->pins[i].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
- b->pins[i].gpio.pinmap = -1;
+ b->pins[i].gpio.pinmap = i;
+ }
+
+ //Updating I2C bus structure
+ for (i = 0; i < i2c_busses_count; i++) {
+ b->i2c_bus[i].bus_id = i;
+ b->i2c_bus[i].sda = -1;
+ b->i2c_bus[i].scl = -1;
+ }
+
+ //Updating SPI bus structure
+ for (i =0; i < spi_busses_count; i++) {
+ b->spi_bus[i].bus_id = i;
+ b->spi_bus[i].slave_s = -1;
+ b->spi_bus[i].three_wire = -1;
+ b->spi_bus[i].sclk = -1;
+ b->spi_bus[i].mosi = -1;
+ b->spi_bus[i].miso = -1;
+ b->spi_bus[i].cs = -1;
}
b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
