Commit graph

13 commits

Author SHA1 Message Date
Marti Bolivar 139ea7c353 Bring back and fix up util.c functionality.
Rip out the existing nonportable pieces, and shove them under
wirish/stm32f1, using weak symbols so users who only want libmaple
proper don't end up with build errors. Add stubbed-out (and only
partially functional) definitions for F2 targets under wirish/stm32f2.

The behavior on F103 targets is the same as it was before (though the
assertion framework has always been broken and badly needs
replacement, that awaits another commit). We additionally now skip
re-enabling USB on F1 targets without USB, to make things work on
value line MCUs.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-26 18:03:40 -04:00
Marti Bolivar e3fc4cd14d Typo fix.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-12 16:03:17 -04:00
Marti Bolivar 93eb9368db Bring back <wirish/wirish_debug.h>.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-08 18:34:33 -04:00
Marti Bolivar 4e20383ff5 STM32F2: Allow boards to override PLL configuration.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07 03:38:29 -04:00
Marti Bolivar cc28a31a5b wirish: Weaken boards_private.h definitions.
This lets users override them conveniently if our decisions don't
suit.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-07 03:38:29 -04:00
Marti Bolivar c2a5783312 STM32F2: Turn on SYSCFG I/O compensation during init().
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03 22:45:41 -04:00
Marti Bolivar 647c4b1027 STM32F2: Add SYSCFG support.
Turn it on at init() time on F2.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03 22:44:43 -04:00
Marti Bolivar cd494c17d9 STM32F2: Add timer_get_af().
Pull some code out of the F2 pinMode() into a utility function. This
feels generally useful enough to be exposed to the users (it will, for
example, make it easier to implement input capture in a clean way).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03 00:04:01 -04:00
Marti Bolivar 07dc3d1753 STM32F2: fix pinMode() for PWM, PWM_OPEN_DRAIN.
Make it so the call to gpio_set_modef() actually happens.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-03 00:04:01 -04:00
Marti Bolivar 6c52b7e870 Bring timer initialization back to init().
Turns out the F1 code was pretty portable after all, so take it from
the F1 boards_setup.cpp and stick it back into boards.cpp. The only
change needed was to add a call to the newly-minted
timer_has_cc_channel() (and this is necessary on F103 XL-density,
anyway).

Also assert LeafLabs copyright in boards.cpp. We really need to do
this throughout the library; it's basically been rewritten since
Perry.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-06-02 21:04:13 -04:00
Marti Bolivar 9d8a2d7d0e examples/blinky.cpp works on F2.
Only OUTPUT mode is tested; any other modes might work, but no
guarantees.

Bring back:

- wirish/wirish_digital.cpp
- wirish/cxxabi-compat.cpp
- wirish/wirish_time.cpp

Add new:

- wirish/stm32f1/wirish_digital.cpp
- wirish/stm32f2/wirish_digital.cpp

Move pinMode() from wirish/wirish_digital.cpp into the file by the
same basename in wirish/stm32f1. This implementation is tied to
F1. Add an F2 implementation in wirish/stm32f2/wirish_digital.cpp.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:41 -04:00
Marti Bolivar a949744d3c Resurrect ADC support.
Standard refactoring: add series headers for F1 and F2, along with
series adc.c files. There are some issues relating to adc_extsel_event
to hammer out later, but this will do for now.

We also add some new portability interfaces to libmaple/adc.h in order
for Wirish to use the same code to initialize the ADCs at init() time.

As usual, F1 is untested.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 87ce0f6c58 [FIXME] Resurrect boards.cpp for F2 and F1.
FIXME:

- F1 support currently appears to be failing in start_c.c, for some
  unknown reason. This will need to get sorted out later.

Add a new wirish namespace, and a sub-namespace wirish::priv::. Put a
bunch of board setup routines in this namespace, and declare them in
new wirish/boards_private.h. boards.cpp uses this to perform
initialization tasks in a portable way, with two new boards_setup.cpp
files under wirish/stm32f1 and wirish/stm32f2 handling the
series-specific details.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00