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.
Thanks to Thomas Otto for pointing out problems with the clock code in
examples and his clock routine implementations. Based on that the most
common clock combination routines were added to the library and all
routines in examples setting up the clock replaced with calls to that
functions.
Thomas Otto has tested the code by successfully talking to a temperature
sensor from ST in master tranciever mode.
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
All handlers are weak symbols pointing to a null handler (doing nothing)
or blocking handler (running an infinite loop). This means you can
define a function with the name in the list and the linker will use your
definition instead of the default one. This makes it easy to implement
your own handlers without touching the library code.
For now, add the following basic SPI functions:
- spi_init_master()
- spi_write()
- spi_read()
This is incomplete and untested, yet.
Also, add some more SPI bit definition macros and comments.