I have been building a set of utility functions that sit "beside" the libopencm3 library and make it a bit faster/easier to generate code that uses libopencm3. One piece that seems particularly useful is the 'pins' api, which is a higher level expression of the gpio_xxx api that loc3 currently has. Things that I like about my version are that you can say (for example)
pin_attributes(PIN_FAST, PB5, PB6, PC0, PD0, PD1, PD8, PD9, PD10, PD14, PD15, PE0, PE1, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG4, PG5, PG8, PG15, PXX); pin_function(AF12, PB5, PB6, PC0, PD0, PD1, PD8, PD9, PD10, PD14, PD15, PE0, PE1, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG4, PG5, PG8, PG15, PXX); To initialize the pins in the SDRAM peripheral for example. It takes care of enabling the clocks for the GPIOs, the output speed setup and the alternate function setting. The downside is that if you miss the PXX at the end it can provide a hard to diagnose failure. So far though the upside has been worth it. --Chuck ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ libopencm3-devel mailing list libopencm3-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libopencm3-devel