797 Commits

Author SHA1 Message Date
Guillaume Revaillot
a34da53c30 stm32g0: add dmamux
DMAMUX peripheral is a dma request router/trigger, present on g0, wb, h7 and l4+.

Basically it allows to easily map peripheral requests to whatever dma channel we
want to use (similarily to the DMA_CSELR register, but without limitation) but,
it also also adds some clever dma request synchronization and even some dma request
generation logic via internal request generator "channels", allowing some requests
chaining, or triggering reqs from non dma capable peripherals.

nb: g0 only features 1 dmamux bloc, supports 7 irq and 4 generators, l4+ supports 13
dma channels and 3 generators and h7 has two dmamuxes, with support for the 15 dma
channels and 7 generators - so as much CxCR and RGxCR register - but they are bit
to bit compatible - excluding of course the sync/sig and dma requests id mappings.
btw, currently, request generator channels are defined in common header, but maybe
we should define them in device header ? or we dont care (like for dma channels,
only defined in dma_f24 but not for other devices ?).

See ST AN5224 for more information
2019-11-08 13:47:41 +01:00
Guillaume Revaillot
b9f183bf1e stm32g0: add dma.
same same, bit for bit, except not ;) - Channel request mapping now
depends on a new DMAMUX peripheral, and there's no default preset.
So, before enabling dma channel after its configuration, request
must be configured by :

dmamux_set_dma_channel_request(DMAMUX1, DMA_CHANNELx, request_number_from_datasheet);
2019-11-08 13:47:41 +01:00
Nicholas Rossomando
77d96a3430 stm32l0: crc: enable common code 2019-10-12 14:11:39 +00:00
Karl Palsson
66e6a2092e doc: stm32f1: gpio: remove redundant doxygen types
Fixes https://github.com/libopencm3/libopencm3/issues/1108
2019-09-30 10:28:21 +00:00
Jonathan Halmen
ec2d96433f stm32f4: rcc: add plli2s config function 2019-09-27 13:55:56 +00:00
Guillaume Revaillot
2035d84e55 stm32: lptim: add base support
Add basically what's needed to have some minimal but usefull subset of
function for a timer: irqs, compare, period, out polarity, enable/disable
and start.
2019-07-05 11:43:11 +02:00
Karl Palsson
8b4d952629 doc: stm32f3: adc: add missing parameters
Minor, link the adc peripheral parameter in a couple of places
2019-06-27 14:53:09 +00:00
Guillaume Revaillot
05214d826a stm32l0: consistent makefile.
sorted and styled per the rest of the project
2019-06-18 13:48:57 +02:00
Guillaume Revaillot
615918ffde stm32g0: compile spi_common_v1.c
fix #1067
2019-06-17 22:34:51 +00:00
Karl Palsson
1bc8a015f7 doc: stm32: timer: fix trivial parameter misnaming 2019-06-17 22:33:32 +00:00
Karl Palsson
9165c8c567 stm32l1: consistent makefile
sorting and unifying specific/shared.
2019-06-17 22:33:32 +00:00
Karl Palsson
5060790133 stm32l4: sort makefile
Consistent with all others.  The separation of the common and specific
portions is unnecessary and misleading.
2019-06-17 22:33:32 +00:00
Karl Palsson
3fe8c3cf93 stm32f7: makefile consistent style
Had already been sorted like f4, just use the same style as everywhere
now
2019-06-17 22:33:32 +00:00
Karl Palsson
00f947ec84 stm32f4: consistent makefile
Had already been sorted, now just make it consistent format with the
others.
2019-06-17 22:33:32 +00:00
Karl Palsson
48eb9957d6 stm32f3: sort makefile 2019-06-17 22:33:32 +00:00
Karl Palsson
17a0e30cd8 stm32f2: Sort Makefile 2019-06-17 22:33:32 +00:00
Karl Palsson
8002148286 stm32f1: Makefile: sort objects
periphs, ethernet, usb. Sorted for ease of finding, ease of merging.
2019-06-17 22:33:32 +00:00
Karl Palsson
452b39555b stm32f0: sort makefile object list
Consistent approach, easier to find what you need, easier to merge
2019-06-17 22:33:32 +00:00
Karl Palsson
2d0d29d946 doc: stm32l1: timer: fix params, missing groupings 2019-06-17 22:33:32 +00:00
Karl Palsson
c28a5a81cf stm32: rng-v1: fix missing doxygen parameter 2019-06-17 11:48:18 +00:00
Guillaume Revaillot
7d344b187d stm32: dma: add dma_set_channel_request to ease dma cselr usage. 2019-06-17 11:44:44 +00:00
Karl Palsson
6c1f54dcb7 stm32g0: sort makefiles
easier to merge, easier to find things you're looking for.
2019-06-13 21:30:06 +00:00
Guillaume Revaillot
ab1b0c1a5e stm32g0: exti doc fixup 2019-06-13 12:04:58 +02:00
Guillaume Revaillot
8173fb7249 stm32g0: add timer.
Only tim2/3/7/14 have been really tested yet - but the others should
work as well.
2019-06-13 12:04:58 +02:00
Guillaume Revaillot
74526f00cc stm32g0: add crc.
Regular crc-v2 peripheral, except that CRC_IDR is now 32bit wide - but
not used.
2019-06-13 12:04:58 +02:00
Guillaume Revaillot
38006c3c82 stm32g0: add rng.
Regular rng peripheral, with one additional bit : clock error detection
apparently available on l4 chips).  Curiously, Clock error detection is
_disabled_ when bit is set, but bit is cleared by default, so peripheral
/ clock error detection behaves like all other chips..

NB: RNG need proper rcc_ccicr_rngsel bits set to work, no clock is set by
default. Note also that on that chip fRNGCLK must be higher than fHCLK/32
2019-06-13 12:04:58 +02:00
Guillaume Revaillot
5a349d3ab6 stm32g0: add i2c.
Regular i2c peripheral.
Partially tested as i had no i2c slave on hand, but i can see i2c on my scope..
2019-06-13 12:04:58 +02:00
Guillaume Revaillot
ba3b50a4ad stm32g0: add spi.
classic "common" spi + frf bit spi peripheral.
As for i2c, i could only check signals on scope, no spi slave to check, but looks ok.
2019-06-13 11:56:20 +02:00
Guillaume Revaillot
a51ecb4719 stm32g0: add usart. 2019-06-13 11:56:20 +02:00
Guillaume Revaillot
bb98d0755c stm32g0: add iwdg.
regular v2 iwdg.
2019-06-13 11:07:53 +02:00
Eric Van Albert
3d422a930f stm32l4: add common DAC support
Replace the DAC1_BASE style, only used on l4 with the standard DAC_BASE
used on all other targets.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-06-12 23:25:22 +00:00
Karl Palsson
209dea96e7 doc: stm32g0: rcc: fix missing/typod param names 2019-06-12 23:20:59 +00:00
Karl Palsson
9f58ad4393 doc: fix trivial missing trailers or typos 2019-06-12 23:16:58 +00:00
Karl Palsson
55c899c93b doc: stm32l0: rcc: add groups requested by existing docs
And cleanse the arguments to all match the docs.
2019-06-12 23:06:28 +00:00
Karl Palsson
5eefc214f6 doc: stm32: fix "osc" incorrect linkages
Was copied around a lot, was always wrong.
2019-06-12 23:06:27 +00:00
Karl Palsson
4533b1be68 doc: fix some trivial parameter name style problems
Just gets them out of the way so we can do bigger item changes.
2019-06-12 23:06:27 +00:00
Karl Palsson
9904f9803e doc: stm32: unify "peripheral API" titles
doxygen really wants the @defgroup _and_ the @addtogroup to both have
the full name, matching identically, to avoid all warnings.

Standardize on the "CAPS_PERIPH peripheral API" style.
2019-06-12 23:06:22 +00:00
Guillaume Revaillot
f38c6f4f91 stm32l0: rcc: doc: fix rcc_clock_setup_pll brief.
rcc_clock_setup_pll allows to use HSE or HSI as PLL source, comment is misleading.
2019-06-12 23:06:22 +00:00
Karl Palsson
b287bbd322 stm32: hash: move to peripherals API docs
Drop redundant .c files and add groupings and labels.  Eliminates
warnings from doxygen
2019-06-12 23:06:22 +00:00
Karl Palsson
a143e5644e doc: stm32f1:rtc: fix trivial param typos 2019-06-12 23:06:22 +00:00
Karl Palsson
9a53dc3a89 doc: stm32f0: adc: fix missing param (trivial) 2019-06-12 23:06:22 +00:00
Karl Palsson
cfdb9b7856 doc: stm32f0: rcc: add groups and tags for bus prescalers 2019-06-12 23:06:22 +00:00
Karl Palsson
e8f03b4615 doc: usbd: Add missing / incorrect parameters.
Just basic documentation to clear up errors for starters.
2019-06-12 23:06:22 +00:00
Karl Palsson
020d883338 doc: stm32: flash: fix missing doxygen trailer 2019-06-12 23:06:22 +00:00
Karl Palsson
c9d45e0e2c doc: stm32: move RCC to peripheral api style
For f7, it was completely missing doc markers
2019-06-12 21:56:09 +00:00
Karl Palsson
7be50a5e75 make: use $(PREFIX)gcc instead of $(PREFIX)-gcc
The leading - makes it rather inconsistent with the majority of other
projects around the world.  Use the form everyone else uses.
To solve this, properly pass prefix to inner makes as was always
intended.

Fixes: https://github.com/libopencm3/libopencm3/issues/1058
2019-06-07 21:25:46 +00:00
Guillaume Revaillot
a652856533 stm32l0: rcc: add rcc_set_peripheral_clk_sel(periph, sel) 2019-06-03 22:29:45 +00:00
Guillaume Revaillot
8668f9198b stm32l0: rcc: add peripherals clock source selection helpers. 2019-06-03 22:29:45 +00:00
Guillaume Revaillot
6953138a28 stm32l0: add rcc_set_msi_range. 2019-06-03 22:29:45 +00:00
Bruno Randolf
53ce5aa3dd stm32:l4:flash: Fix option bytes programming
FLASH_CR_OPTSTRT needs to be written to FLASH_CR, and there is no reason
to mask the last two data bits.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
(original code appeared to be badly copied from the flash_common_f24 codebase)
2019-06-02 22:18:14 +00:00