Hi,
I noticed that the nRF9160s I2C low level logic voltage is quite high. With a 2kR resistor at 3.3V it's already more than 200mV. Because this is quite high and will get even more when the resistor gets smaller, I wanted to increase the GPIO drive strength to keep some margin. It seems the nRF9160 has two drive strength levels, standard and high drive.
I was able to change the drive strength on the I2C peripheral just by trying to change the GPIO configuration and adding the GPIO_DS_ALT_LOW flag. However, with this way of changing the configuration it's important to not forget any of the other 'default' I2C peripheral flags, like GPIO_OPEN_DRAIN and GPIO_OUTPUT. When I played a bit around with the config I found that these flags were necessary:
gpio_pin_configure(gpio_dev, 9, GPIO_OUTPUT | GPIO_DS_ALT_LOW | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW);
With this config it seems to work, but I don't like the approach of having to guess the default flags and having to change this in the main code (I would prefer to have this changed at boot time). Is there any way of specifying this in the devicetree or some way of appending flags so I keep the default?
Thanks,
Martin