Commit Graph

253 Commits

Author SHA1 Message Date
Karl Palsson 8435287300 stm32: dma: doxygen fixups
Use a single @defgroup for the "root" of a common heirarchy, and only
addtogroup for additions.  This prevents an alphabetically "first" entry
from being used as the documentation for the entire group.
2020-12-02 00:04:44 +00:00
Karl Palsson f82053000c stm32: crs: fix doxygen
We need per device header includes to make the per target documentation
generation work properly.  The dispatch headers are to dispatch to the
_target_ not directly to the final implementation, remember, the final
required headers for each may be multiple files, plus extra definitions!
2020-12-01 23:13:38 +00:00
Brian Viele e41ac6ea71 stm32: added peripheral clock get helpers for all stm32 platforms.
Allows for abstraction for code that's dependent on knowing the source clock
for a peripheral. Implemented a few core peripherals that tend to have clock
tree differences between platforms (USART, timers, I2C, SPI).
2020-11-28 22:13:25 +00:00
Karl Palsson daf99b9b76 stm32: dcmi: hook up doxygen again
We still need stub .c files as we're using shared common files, so .d
tracking doesn't work.  It lets us setup basic introductory text anyway,
and there will be .c files eventually, so acceptable.
2020-11-28 22:13:25 +00:00
Themroc d8d63b3184 stm32: timer common all: Fix documentation
Provide gpio examples for both f1 and "everyone else" gpio blocks

Originally filed at: https://github.com/libopencm3/libopencm3/pull/1243

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
 (Merged old and new into two new examples)
2020-11-28 22:13:25 +00:00
tute-avalos b47d769369 stm32: uart: Add Trasmission Complete enable/disable interrupt functions 2020-11-28 22:13:25 +00:00
Karl Palsson 43b3fa5ddc stm32l0/l1: flash: support half page flashing
Tested on L1 and L0 using the "dapboot" project, see
https://github.com/devanlai/dapboot/pull/27 for L1
and
https://github.com/devanlai/dapboot/pull/30 for L0
2020-11-28 22:13:25 +00:00
Dima Barsky 08c5f2a1fb stm32: i2c-v1: Fixed a typo in i2c_read7_v1 and i2c_write7_v1
Replaced & with &&
Wait for all three bits to be set - SB, MSL, and BUSY.

Old code worked by chance, use booleans to correctly convey intent.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-10-16 12:00:20 +00:00
rma-x 24bef9c49e stm32:adc: Change bitwise AND to logical AND
The original bitwise AND was _functionally_ correct because all operands
were booleans, but it was very poor at conveying the intent.

Fixes #1230
2020-07-03 12:27:44 +00:00
François Finfe fb0cac49cb stm32: adc-v2: add adc_{en,dis}able_delayed_conversion_mode
To control AUTODELAY feature of the ADC.
2020-03-04 23:29:31 +00:00
Matthew Lai 97688b913e stm32: desig: refactor to allow targets to have different addresses
In this commit, support for the different base addresses for different
F7 parts is added, but the mechanism is now in place for L1 and others.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
(whitespace fixed, commit msg reworded)
2020-03-04 22:16:31 +00:00
Karl Palsson 8c37e5cea0 stm32: crc: merge duplicate documentation
Avoids warnings from doxygen.  Leaves it purely in the headers so it's
accessible in code completion as well.
2020-01-28 22:41:14 +00:00
Guillaume Revaillot a8a92b4c11 rng: fix clock error handling, based on RM.
According to L4/L0/G0 RM, in case of clock error, interrupt flag must
be cleared, and CECS flag should be cleared as soon as clock meets
requirement.

Reviewed-on: https://github.com/libopencm3/libopencm3/pull/1062
2020-01-05 00:25:12 +00:00
Guillaume Revaillot 5866852a90 rng: handle noise source / seed error.
If noise source error occurs, flag must be cleared and data register
must be discarded (at least 12 reads to flush pipeline on G0). Other
device mention start/restart of chip, so, do both (better safe than
sorry).

Reviewed-on: https://github.com/libopencm3/libopencm3/pull/1062
2020-01-05 00:25:00 +00:00
Guillaume Revaillot 5a53f18a78 rng: check error before checking if data ready.
mostly cosmetic, but ease debugging.
2020-01-05 00:24:43 +00:00
Guillaume Revaillot 64baacfbbf rng: add irq enable/disable helper. 2020-01-05 00:24:43 +00:00
Guillaume Revaillot db6237cd1e stm32: extract g0 exti stuff to exti_common_v2.
stm32l5 basically uses the same stuff.
2020-01-01 19:47:13 +01:00
Guillaume Revaillot 169d23568f stm32: lptimer: fix documentation 2019-12-25 20:34:11 +00:00
Karl Palsson a5b6673b62 stm32: usart-v2: fix some doxygen linking problems 2019-12-25 20:30:03 +00:00
Brian Viele aabefeac92 stm32h7: usart: support new fifo features
Supported by H7 and G4 varieties at present.
2019-12-25 20:29:24 +00:00
Karl Palsson 9598b7f424 doc: stm32:rcc: flag "better" periph enable options
The original rcc_peripheral_enable_clock aren't explicitly deprecated,
as they do let you enable multiple periphs in one call.  But they're
error prone, from user feedback, so update the docs to ensure people
know what the other options are.
2019-12-12 20:37:58 +00:00
Karl Palsson 557e7aa50f doc: avoid usage of rcc_peripheral_enable_clock
Use the simpler, safer rcc_periph_clock_enable instead
2019-12-12 20:35:57 +00:00
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 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 1bc8a015f7 doc: stm32: timer: fix trivial parameter misnaming 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 9f58ad4393 doc: fix trivial missing trailers or typos 2019-06-12 23:16:58 +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
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 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
Bruno Randolf 833ddd9b0a stm32: rtc: clear wakeup clock selection
Clear wakeup clock selection before setting the desired bits, so no
old bits can stay set

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-06-02 22:18:05 +00:00
Karl Palsson f2a9980638 stm32: doc: rtc: move to peripheral apis
Drop some dummy.c files, add some missing groupings and make sure all
specifics are included in the generated output.
2019-05-22 00:16:40 +00:00
Karl Palsson 0aef9c2ec6 stm32: doc: pwr: move to peripheral_api
Some families had partially moved to peripheral api, and others were
only documenting common code, but not specific code.  Delete dummy .c
files, and check that all specific apis are also being documented, not
just common apis.
2019-05-22 00:10:39 +00:00
Karl Palsson da76279bc6 stm32: flash: move to peripheral_apis
Change the groupings and headings to make them all consistent.
2019-05-21 23:41:21 +00:00
Karl Palsson 1001a9323b stm32: doc: dma: move to peripheral_apis
drops dummy .c files, and adds proper groupings to the shared files.
2019-05-21 23:27:21 +00:00
Karl Palsson 9382042180 stm32: doc: move timer to peripheral_apis
Drop all the dummy timer.c files, and _actually_ compile the L1 specific
file that was dropped by accident in 5b8953124e in 2013!
2019-05-21 23:17:04 +00:00
Karl Palsson 508f8d9487 stm32: doc: gpio: move gpio to peripheral_apis
Drops dummy gpio.c files that weren't even being compiled in some cases.
2019-05-21 23:16:59 +00:00
Karl Palsson d77f539013 stm32: doc: rng: migrate to peripheral apis
Gets them all documented properly, and cleans up the language that this
was just for F4.
2019-05-21 23:16:59 +00:00
Karl Palsson 1af3acdba4 stm32: doc: exti: fix missing/wrong groups and move to peripheral_api
Almost all families were missing all docs for the exti apis.
2019-05-21 23:16:59 +00:00
Karl Palsson fe5e82a3cc stm32: doc: dac: move to peripheral_apis.
Drops all the stub dummy header files, many of which weren't even being
built, and moves them to the clean peripherals_api doc section.
2019-05-21 23:16:51 +00:00
Oliver Meier 07868ad8b6 stm32f7: enable existing dma2d headers 2019-05-19 21:33:07 +00:00
Oliver Meier 92a2340551 stm32f7: enable existing dsi support 2019-05-19 21:33:07 +00:00
Oliver Meier 5a03cfe54e stm32f7: enable existing ltdc
This uses the existing f4 code as a new shared common base code.
2019-05-19 21:33:02 +00:00
Oliver Meier 16cfc6d848 stm32f7: enable fsmc
This uses the existing f4 code as a new shared common base code.
2019-05-19 21:30:48 +00:00
Oliver Meier 4fc7196463 stm32f7: enable existing exti headers 2019-05-19 21:30:38 +00:00
Karl Palsson e77bc94b8c stm32: adc-v1m: doc cleanups
Try and fix some of the specifics from old f4 source material.
2019-05-10 23:15:42 +00:00
Karl Palsson 8d9b455ac6 stm32: adc-v1m: pull out f4/f7 specifics
Sampling time and sequence length, along with the vbat channel are
specific to the f4/f7, and can't be shared with the l1 and friends.
Pull them out to their own common file.
2019-05-10 22:42:03 +00:00