aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-06-07wirish/syscalls.c: Weaken I/O related function defs.Marti Bolivar
For overriding. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Move syscalls.c into Wirish.Marti Bolivar
libmaple takes orders, it doesn't give them. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07libmaple/timer.h: Capitalization fixMarti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07libmaple/timer.h: Lose BIT().Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07libmaple/timer.h: Move deprecated bits to bottom.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07struct timer_dev: Don't touch ->handlers!Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07libmaple/timer.h: Nuke useless comment.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07libmaple/timer.h: Doxygen beautification and fixupsMarti Bolivar
Make the Doxygen comments nicer to look at. Some of the docstrings are out-of-date since F2 support was added, so update them. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Makefile: fix cscope target.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Move timer_dev definitions into libmaple/timer.c.Marti Bolivar
The addition of STM32_HAVE_TIMER() allows us to avoid some repetition. There's still an issue with names on F1 preventing us from moving the IRQ handlers to libmaple/timer.c, but once that's resolved, we'll be able to remove even more. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Tweak some timer_private APIs.Marti Bolivar
The current versions of DELARE_*_TIMER() don't play well with cscope, which is a bad sign. Fix that. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07series/timer.h: Remove silly duplicate declarations.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Makefile: help target pointers for multiple source files.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07README: remove mention of support/openocd/.Marti Bolivar
This is now in contrib/. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Rework linker scripts.Marti Bolivar
Having separate linker scripts for all the boards is a bad idea. Most boards really only need to specify MEMORY and the appropriate REGION_ALIASES() so that support/ld/common.inc can do its work. Not having infrastructure for this leads to duplication -- viz. the Maple Mini linker scripts are identical to the Maple's, and the olimex_stm32_h103 linker directory is just a symlink to Maple's. Clearly, the current structure is wrong. To fix it, instead of having per-board subdirectories of support/ld/, add per-MEMORY subdirectories of (new) support/ld/stm32/mem/. The per-board .mk files under support/mk/board-includes/ now reference these directly, and target-config.mk and the Makefile handle this appropriately. We move some other stuff around in target-config.mk to make this all more convenient, and even allow more overriding of the libmaple defaults on a per-board basis. Custom board hacks will be easier now. Unfortunately, lots of duplication under support/ld/stm32/mem/ is necessary, as the LENGTH attribute in a MEMORY region specification doesn't support arithmetic expressions, and ld doesn't seem to have any way to specify MEMORY at the command line (why?!). If we find a better way than this, we should do it. If a board (e.g. Maple Native) _does_ really need special memory-related configuration, you can always put a per-board subdirectory of support/ld/stm32/mem. We do this here to configure the heap. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Move OpenOCD stuff into contrib/.Marti Bolivar
This has gone unmaintained for long enough. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Makefile: make help target more helpful.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Makefile: add list-boards target.Marti Bolivar
As the number of boards increases, it's less practical to keep a list of them in the help target output (notice also that some have been forgotten). This target can't get out of date unless we change how the board-includes/ directory works. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07maple/board.cpp: Demo weakness of boardInit().Marti Bolivar
This shows people what to do to write boardInit(), but also how to save work if they don't need it. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07maple/board.cpp: Use PMAP_ROW().Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07board_private.h: Add PMAP_ROW() convenience macro.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07maple/board.cpp: Add more explanatory comments.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07isButtonPressed(): Take a pin and pressedLevel argument.Marti Bolivar
This allows dealing with push-buttons on pins other than BOARD_BUTTON_PIN. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07<wirish/boards.h>: Add BOARD_BUTTON_PRESSED_LEVEL.Marti Bolivar
This allows boards to override the logic level of a pressed button. All Maple boards have a pressed button read HIGH, but if the opposite convention is used, isButtonPressed() will infinite loop. Make isButtonPressed() respect this setting. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07wirish/boards.h: Optionally derive SYSTICK_RELOAD_VAL.Marti Bolivar
It's stupid to make everyone keep this around. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07STM32F2: Allow boards to override PLL configuration.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Makefile: move the fake VID/PID, to hide our shame.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07stm32.h: Soften "missing MCU" errors into warnings.Marti Bolivar
It's not important whether the MCU is specified. What's important is that <libmaple/stm32.h> gets everything it needs -- which it now ensures that it does. Requiring people to do things on a per-MCU basis hurts hackability and is just asking for trouble. On the other hand, it's nice to provide a clue as to why <libmaple/stm32.h> might be giving #errors, so do leave the warnings. People can always hack the header to shut them up if they want. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07HardwareSerial.cpp: Fix "#warn" -> "#warning".Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07wirish: Weaken boards_private.h definitions.Marti Bolivar
This lets users override them conveniently if our decisions don't suit. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Provide wirish::priv::series_init() on F1.Marti Bolivar
This lets us remove the weak definition in boards.cpp. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07Remove a completed FIXME comment.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-04Bring back libmaple/dac.h.Marti Bolivar
Minor variations on F2: DMA underrun interrupts, and a status register to hold the notification bits. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-04stm32.h: Add STM32_HAVE_DAC feature-test.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-04STM32F1: gpio.h: Add hack mode macro, for F2 compatibility.Marti Bolivar
I'm sure we can work the compatible subset of F1/F2 GPIO functionality into the F1 gpio.h interface in a clean way. This is not that clean way, but I'm short on time. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03STM32F2: Add EXTI support.Marti Bolivar
Add series headers to keep the base pointers, and (on F2) use SYSCFG to tell exti_do_select() where the EXTI control registers are. No surprises. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03STM32F2: Turn on SYSCFG I/O compensation during init().Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03STM32F2: Add SYSCFG support.Marti Bolivar
Turn it on at init() time on F2. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03STM32F1: gpio.h: Cosmetics.Marti Bolivar
Those ugly Doxygen comments have been bothering me since forever. Fix them up and throw some M-x align around. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03Bring back EXTI on F1, with deprecations for gpio.h on F1.Marti Bolivar
Tested on Maple Mini with examples/mini-exti-test. Changes to Wirish are minor: use the new EXTI types exti_num and exti_cfg (see below) in place of now-deprecated variants in ext_interrupts.cpp. The way I originally did libmaple/exti.h was stupid, and fixing it turned out to be a little disruptive. libmaple/exti.h depends on libmaple/gpio.h (for AFIO), but that's a classic case of exposed implementation detail. So invert the dependency: make gpio.h depend on exti.h. Do this by adding exti_num and exti_cfg to exti.h; these respectively replace afio_exti_num and afio_exti_port. The afio_* variants are now deprecated. (Throw in a typedef and some macros at the bottom of the F1 series/gpio.h for backwards compatibility). Make exti_attach_interrupt() and exti_detach_interrupt() take exti_num/exti_cfg arguments instead of the afio_* variants. Make the EXTI dispatch routines __always_inline to defeat GCC -Os. Many renames throughout libmaple/stm32f1/ to stop using the deprecated names. Also move the previously F1-only gpio_exti_port() function into the public libmaple header. Reimplementing it in terms of rcc_clk_ids lets us deprecate the gpio_dev->exti_port field, which will save space in the future. While we're there, I notice that struct gpio_dev is defined once per series. That's dumb, as it misses the entire point of having device structs: they contain what's portable. So put the F1 version (which has the extra EXTI port field) into libmaple/gpio.h, and add the necessary exti_ports to libmaple/stm32f2/gpio.c. Sigh. We'll get rid of it eventually, at least. Clean up some other mistakes in gpio.h files as well (mostly removing util.h dependency). Sorry for the messy commit. For portability, add a new series-specific exti function, exti_select(). The F1 version in (new) libmaple/stm32f1/exti.c uses AFIO and some new private functionality in libmaple/exti.c and (new) libmaple/exti_private.h to make this convenient. We'll be able to do the SYSCFG equivalent on F2 without any trouble. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03<libmaple/bitband.h>: DoxygenMarti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03libmaple/dac.c: Copyright.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03libmaple/dac.c: Generalize comment about PA4/PA5.Marti Bolivar
Seems like this is true on F2 as well! Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03wirish/ext_interrupts.cpp: Doxygen, copyright.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03Add ISRs and vector table for F1 value line.Marti Bolivar
Now libmaple/stm32f1/rules.mk tries to pull in ISRs and a vector table on a per-line basis. Move isrs_performance.S and vector_table_performance.S to (new) libmaple/stm32f1/performance, and rename them. Add corresponding files for value line under (new) libmaple/stm32f1/value. This helps clean up some performance-line-isms, and allows implementing e.g. the CEC interrupt, which is used by something else on performance line. Untested (I don't have access to a value line MCU); hopefully this works. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03Slightly improve and generify the USB infrastructure.Marti Bolivar
The good news is that <libmaple/usb.h> and <libmaple/usb_cdcacm.h> did turn out generic enough in what they specify to go on unchanged. However, we can't just go on assuming that there's USB just because we're on an F1. Now that there's value line in the tree, we need to be more careful (value line F1s don't have USB peripherals). To that end, make all the F1 board-includes/*.mk files specify what line their MCU is with an MCU_F1_LINE variable. Use that to hack libmaple/usb/rules.mk so we only try to build the USB module under appropriate circumstances. While we're at it, add a vector_symbols.inc for value line MCUs under support/ld/. We need this to get the target-config.mk modifications implied by the addition of MCU_F1_LINE. We'll fix up some other performance-line-isms under libmaple/stm32f1 in a separate commit. Also in libmaple/usb/: - Move everything into a new stm32f1 directory. Due to aforementioned rules.mk hacks, there is no immediate need for an stm32f2 directory (USB support doesn't exist there). - Update the README for style and content. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03Add BOARD_HAVE_SERIALUSB.Marti Bolivar
Feature-test for SerialUSB support. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03<wirish/boards.h>: Add feature test macros for SPI.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03libmaple_types.h: Add __unused.Marti Bolivar
We'll need this soon. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03F2: Add usart_get_af().Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>