This patch, a slightly modified version of a patch from Thomas Otto,
should fix the following two issues:
- It generally sets the submited config to the mentioned GPIO pins but
kills configs for other pins on the same GPIO port. So if we want to set
PB6 and PB7 to push-pull and I2C2 SDA and SCL (PB10 and PB11) to open
drain it's simply impossible, because the second config try kills the first.
- The floating-bit thing isn't working correctly. If we enable a config
for PB6 for instance, the same config will also apply to all following
pins of that port (i.e. PB7-PB15). That's because the shifting isn't only
done if a pin isn't to configure, if you are hitting a matching bit the
shiftig is missing. I think shifting isn't nessessary for a separate
variable. We have the counting index from the for statement.
Both issues should now be fixed.
This currently includes a number of basic functions. Example usage:
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO12);
gpio_set(GPIOB, GPIO4);
gpio_clear(GPIOG, GPIO2 | GPIO9);
gpio_toggle(GPIOA, GPIO7);
reg16 = gpio_port_read(GPIOD);
gpio_port_write(GPIOF, 0xc8fe);