Guillaume Revaillot
ec597796d7
stm32g0: fix bad typos in memorymap, impacting tim1 and tim15-17.
2019-08-27 16:24:42 +02:00
Guillaume Revaillot
3eff201a4b
doc: stm32: adc: upgrade common_v2 documentation
...
add register grouping, fixup comment have them pickedup by doxygen, align style and masks.
2019-07-06 15:38:49 +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
Guillaume Revaillot
f99e711873
stm32g0: lptim: add additional cr bits and cfgr2 reg.
2019-07-05 11:43:11 +02:00
Guillaume Revaillot
811aebf096
stm32: lptimer: enable lptimer.h usage on f4,f7,l4 and g0 chips.
2019-07-05 10:48:55 +02:00
Guillaume Revaillot
2975c3151a
stm32: extract l0 lptimer stuff from timer.h to common lptimer.h
...
lptimer peripheral is present on f4,f7,l0,l4,g0,g4 and prob others. Extract
content from stm32l0 timer.h and make it usable by other chips.
2019-07-05 10:48:26 +02:00
Guillaume Revaillot
689e326f5f
stm32f4: lptim1 sits at 0x40002400 on stm32f410, update memorymap
2019-07-02 18:27:43 +02:00
Karl Palsson
38d88c6113
doc: stm32f0: rcc: add missing groups for pll factors and sources
2019-06-27 14:53:09 +00:00
Karl Palsson
8744df10a6
doc: gd32: make groups match what's used.
...
Fixes the missing top level groupings here.
2019-06-25 21:15:35 +00:00
Karl Palsson
0cd06bcc97
doc: gd32/f1x0: fix missing tags, drop wrong tags
...
Drop incorrect/redundant type information from doxygen parameters
Adds groupings that are referred to.
2019-06-25 21:15:35 +00:00
Karl Palsson
1964fd72f2
doc: stm32f3: adc: register base addresses had landed outside a group
2019-06-25 21:15:35 +00:00
Karl Palsson
1b10a0871c
doc: cm3: mpu: fix typo
2019-06-25 21:15:19 +00:00
Karl Palsson
60991ac306
doc: cm3: nvic: convert existing docs to doxygen
...
Make it visible
2019-06-25 21:15:19 +00:00
Karl Palsson
69ce9f876f
doc: core cm3: standard titles
...
easier on the eyes reading the list of docs
2019-06-25 21:15:19 +00:00
Karl Palsson
f63145db07
doc: stm32f7: rcc: add missing top level groups
2019-06-25 21:15:19 +00:00
Karl Palsson
1f359e0cb8
doc: efm32: tag USB files for doxygen generation
2019-06-25 21:15:19 +00:00
Karl Palsson
2d1277e1fa
doc: efm32: uart/usart provide common doxygen
...
Fix some direct includes, tag properly, include a stub file to pull in
shared header documentation and re-arrange some existing documentation
to make it present nicely.
2019-06-25 21:15:19 +00:00
Karl Palsson
56265ad93f
doc: efm32: rtc: tag and include in generated output
...
Includes the sutb file ncessary to find shared headers without any apis
2019-06-25 21:15:19 +00:00
Karl Palsson
6df301accc
doc: efm32: timer: properly tag the shared header as well
2019-06-25 21:15:19 +00:00
Karl Palsson
531aa7e6b7
doc: efm32: rmu: include in doxygen generation
...
Include a stub .c file for shared code generation
2019-06-25 21:15:19 +00:00
Karl Palsson
75f6cbfd9d
doc: efm32: msc: tag for doxygen inclusion
...
Includes a stub .c file to trigger common code generation
2019-06-25 21:15:19 +00:00
Karl Palsson
c92f3dc0ad
doc: efm32: letimer: include tags for doxygen
...
Include a stub .c file to document the shared headers.
2019-06-25 21:15:19 +00:00
Karl Palsson
25dc3a9b4b
doc: efm32: i2c: tag for doxygen
...
Includes a stub .c file until there are some APIs
2019-06-25 21:15:19 +00:00
Karl Palsson
4c01e47aed
doc: efm32: emu: tag for doxygen properly
...
Requires a stub .c file to make the common files be included until we
build some APIs.
2019-06-25 21:15:19 +00:00
Karl Palsson
764fbed9c8
doc: efm32: dac: fix up mising tags on common file
2019-06-25 21:15:19 +00:00
Karl Palsson
790d624230
doc: efm32: burtc: tag properly for doxyen
...
includes a stub .c file until there are APIs defined.
2019-06-25 21:15:19 +00:00
Karl Palsson
aa99aba7d3
doc: efm32: prs: properly tag for doxygen
2019-06-25 21:15:19 +00:00
Karl Palsson
46514e75c0
doc: efm32: dma: tag headers properly
2019-06-25 21:15:19 +00:00
Karl Palsson
7e2cd050aa
doc: efm32: acmp: document, and include via peripheral_apis
...
Requires a stub .c file as it has common includes with out any common
code (yet)
2019-06-22 01:38:20 +00:00
Karl Palsson
0626f6f75d
doc: efm32: adc: enable peripheral_apis style
2019-06-22 01:38:20 +00:00
Karl Palsson
ae777bb920
doc: efm32: timer: enable peripheral_apis style
2019-06-22 01:38:20 +00:00
Karl Palsson
c8b8285446
doc: efm32: dac: enable peripheral_apis documentation
2019-06-22 01:38:20 +00:00
Karl Palsson
35657bdb61
doc: efm32: wdog: enable documentation via peripheral_apis
2019-06-22 01:38:20 +00:00
Karl Palsson
093edfb881
doc: efm32: cmu: move to peripheral_apis
...
Was completely undocumented before. Just needed different tagging so it
could be picked up.
No attempt at this stage of sharing more code between the cmu modules.
2019-06-22 01:38:20 +00:00
Karl Palsson
9bc432474b
doc: efm32: include gpio_common
...
gpio_common was built, but wasn't picked up by any documentation.
Use the peripheral_apis style from stm32, but try out the #pragma once
style. Downside is you don't get warnings if you include an sub layer
.h file. Upsides are
* no ifdef/endif blocks
* no /**@cond*/ /**@endcond*/ blocks
* that's enough win!
2019-06-22 01:38:20 +00:00
Karl Palsson
6d74262bf4
doc: efm32: define peripheral_apis groups
...
Nothing is _in_ these groups yet, but define them so we can start
filling them out. Follows the stm32 family style.
2019-06-22 01:38:20 +00:00
Karl Palsson
92b4b5a12f
doc: efm32: fix typos in family/group names
2019-06-22 01:38:14 +00:00
Guillaume Revaillot
f121c8c8f0
.gitignore: ignore autogenerated include/libopencmsis/swm050/
2019-06-17 22:34:15 +00:00
Karl Palsson
2d0d29d946
doc: stm32l1: timer: fix params, missing groupings
2019-06-17 22:33:32 +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
Guillaume Revaillot
eb0bc099f4
stm32l0: dma: include dma_cselr, present on l0x1-2-3.
2019-06-17 11:44:44 +00:00
Guillaume Revaillot
e06898d9a4
stm32: dma: cselr: factorize register definition.
...
F09x and L4 share the same cselr register, as well as some L0s, factorize
definitions in a new shared header and add helpers.
fyi, that register allows to redefine dma channel peripheral mapping - see
device datasheet for mapping tables.
2019-06-17 11:44:44 +00:00
Karl Palsson
19f1160ad1
doc: stm32: timer: remove redundant groupings and consistent names
2019-06-16 18:17:06 +00:00
Karl Palsson
0b0a4de7c2
doc: stm32l0: fix doxygen groupings.
...
Makes some @ingroup directives redundant.
2019-06-16 18:02:41 +00:00
Guillaume Revaillot
594c354068
stm32: l0: timer/lptimer: doc+
...
better doc for l0 lptimer registers, add mask.
2019-06-16 09:48:34 +02: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
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
7b6ca4be6b
doc: stm32l0: rcc: add groups and tags for bus prescalers
2019-06-12 23:06:28 +00:00
Karl Palsson
a2681b3122
doc: stm32f4: crypto trivial closing tag fix
2019-06-12 23:06:27 +00:00
Karl Palsson
502593ca6f
doc: stm32: exti-v1: fix conditionals, add registers
...
Fixes some missing definitions. cond/endcond is hard to get right
sometimes!
2019-06-12 23:06:22 +00:00
Karl Palsson
867bd164eb
doc:stm32: usart: fix grouping and heirarchy of base addrs
...
They were always landing on the top level, or not even present.
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
121d854841
doc: stm32: crc-v2 fix up markup for doxygen
...
Eliminates errors, fixes groupings, adds missing groupings.
2019-06-12 23:06:22 +00:00
Karl Palsson
7c0320bf21
doc: stm32g0: rcc: add groupings for periph resets
2019-06-12 23:06:22 +00:00
Karl Palsson
4129d89637
doc: stm32f7: rcc: add groupings for periph resets
2019-06-12 23:06:22 +00:00
Karl Palsson
5d3f13c40e
doc: stm32f4: rcc: add groupings for periph resets
2019-06-12 22:56:38 +00:00
Karl Palsson
64893177ed
doc: stm32f3: rcc: add groupings for periph resets
2019-06-12 22:56:38 +00:00
Karl Palsson
5ba8d94b81
doc: stm32l4: rcc: add groupings for periph resets
...
As we did with f2, use a parent grouping to contain the different sets
of APB1 fields.
2019-06-12 22:56:38 +00:00
Karl Palsson
e6e1c239e4
doc: stm32l0: rcc: add groupings for periph resets
2019-06-12 22:56:38 +00:00
Karl Palsson
da3466057b
doc: stm32f2: rcc: add groupings for periph resets
...
We use a parent grouping to make the generic "AHB" groups work, even
though F2 and many later families have AHB1, AHB2 and AHB3
2019-06-12 22:56:34 +00:00
Karl Palsson
21a0c1178c
doc: stm32l1: rcc: add groupings for periph resets
2019-06-12 21:56:13 +00:00
Karl Palsson
c7ce1ddd1a
doc: stm32f0: rcc: add groupings for periph resets
...
As done earlier for other families, makes the doxygen linking working
properly.
2019-06-12 21:56:13 +00:00
Karl Palsson
ce5d1ca9a2
doc: restore targets as pages.
...
You can't have two mainpage items, and the second was just being
ignored. This restores them, which makes the left side list longer,
which we may or may not like, but it's at least how it was documented to
be.
2019-06-10 11:10:34 +00:00
Karl Palsson
d66c8677df
doc: fix example syntax
...
@example is for including a file containing the example code.
2019-06-10 10:59:54 +00:00
Karl Palsson
795fe21860
usbd: document that only 8 eps are allowed.
...
The internal stack has a hard internal limit of 8, which is as many as
all supported devices support, but not as flexible as the arbitrary
addressing that USB actually allows.
At _least_ document this.
Fixes: https://github.com/libopencm3/libopencm3/issues/666
2019-06-05 21:48:28 +00:00
Karl Palsson
1e3741cb20
swm050: doxygen fixups
...
* Include the doc-swm050.h core file that defines the base groups.
* Fix/tweak groupings to make things consistent with other targets.
* Drop redundant type information. That's all included from the function
signatures automatically by doxygen.
* Added register descriptions from datasheet.
2019-06-05 21:31:56 +00:00
Icenowy Zheng
54eff24e7c
swm050: new MCU family
...
SWM050 is a series of MCU made by Foshan Synwit Tech. It contains a
Cortex-M0 CPU core, 8KiB of Flash and 1KiB of SRAM. The only peripherals
are GPIO, Timer and WDT. There's only two parts in this series, with
either TSSOP-8 or SSOP-16 packages.
This commit introduces the interrupt vector and GPIO support for them.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2019-06-05 20:25:43 +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
Karl Palsson
d0c3678f74
stm32l4: rcc: drop bad function prototype
...
This was introduced by a bad merge/rebase leaving a dangling header
definition.
Fixes: b8424263
stm32:l4: rcc: Add RTC clock functions
2019-06-02 22:27:15 +00:00
Sean Cross
065e0412ec
efm32hg: cmu: add USHFRCODIV2 clock definition
...
This clock is the USB High Frequency PLL that gets trimmed based
on clock recovery. It is the most accurate PLL on the system,
assuming it is connected via USB.
Add the definition of this clock in preparation for being able
to switch to it.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-06-02 22:23:44 +00:00
Bruno Randolf
b8424263e8
stm32:l4: rcc: Add RTC clock functions
2019-06-02 22:18:05 +00:00
Bruno Randolf
2c1823f7bb
stm32:l4: pwr: Add en/disable_backup_domain_write_protect()
2019-06-02 22:18:05 +00:00
Bruno Randolf
a1f58ea8ae
stm32:l4: Add interrupts for STM32L4x5/STM32L4x6
...
Add all interrups from RM0351
2019-06-02 22:18:05 +00:00
Bruno Randolf
fe722d4643
stm32:l4: rcc: Add helper functions
...
Add functions for PLL output and 48MHz clock source selection
2019-06-02 22:18:05 +00:00
Bruno Randolf
a1ffdc59f0
stm32:l4: flash: Program in double words
...
According to RM0351 and RM0394 flash needs to be programmed by double words.
Also fix flash_program() which was wrong anyways.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-06-02 22:17:55 +00:00
Karl Palsson
49a3cddba0
stm32f4:rcc: add new api directly to deprecated message
...
This makes the compiler warnings more useful.
2019-06-02 20:36:57 +00:00
Karl Palsson
f990030440
stm32f4: rcc: move deprecated attribute to header
...
This makes it actually generate deprecated warnings. The deprecated
doxygen stays with the .c file as before.
2019-06-02 12:50:34 +00:00
Karl Palsson
a9dde2832e
stm32f4: rcc: drop 48 & 120 MHz configs
...
48Mhz has no purpose other than to be a naiive method of haivng working
USB. 120MHz never had any purpose, other than to match the f2 code it
was copied from. Drop them both. Remaining configs are all max speeds
for various F4 parts. Lower speeds are all custom
2019-06-02 10:50:10 +00:00
Miguel Sánchez de León Peque
1d68c299e8
stm32f4: add HSI clock configurations
2019-06-02 10:39:18 +00:00
Miguel Sánchez de León Peque
ca6dcfbea1
stm32f4: rcc: support hsi pll source
2019-06-02 10:38:43 +00:00
Matthew Lai
eed780e2c1
stm32f7: irqs: Fix typo in i2c4*
...
This also unifies the whitespace in the file.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-05-26 21:34:08 +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
c557ef96f9
stm32f7: doc: adc: fix copypasta doxygen error
...
Was attempting to run add to the f4 docs, which aren't referenced from
the f7 doxygen build, obviously.
2019-05-21 23:45:47 +00:00
Karl Palsson
2bed518f09
stm32f7: doc: flash defines weren't grouped at all
2019-05-21 23:45:34 +00:00
Karl Palsson
1e06c48201
stm32l1: timer: fix typo in option mask definition
...
Found while exploring documentation generation
2019-05-21 23:17:04 +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
75748a7bfc
stm32g0: flash doc: group registers
2019-05-21 21:47:24 +00:00
Karl Palsson
4aa9e484f6
stm32g0: flash: drop redundant docs
...
Functions that are already documented in the top level common api.h file
won't add any more documentation from later .c files. Keep docs for
part specifics, in the .h files where they're accessible to IDEs and
also the documentation generation, and drop all (including the redundant
ones) from the .c file.
2019-05-21 21:46:02 +00:00
Karl Palsson
709d98e0a8
doc: stm32g0: drop redundant @ingroup and close groups
...
the group defaults to the implicit container based on location, so drop
all the explicit @ingroups, less to maintain. Properly use /**@}*/ to
close all groups too, even though it mostly seems to have worked anyway.
Properly close all groups opened for files.
2019-05-21 21:44:05 +00:00
Karl Palsson
bc6af71443
doc: predefine a group for the cortex peripherals.
...
They were all trying to use this, via @ingroup CM3_files, but that group
didn't exist, so they just got left dangling as "systick_file" and
similar.
2019-05-21 21:41:41 +00:00
Karl Palsson
b24d7f96b5
stm32: standardize OSPEED values
...
Make the names match the reference manuals properly, and add missing
names. Still a long way to go to unify across all families, but this is
at least closer.
2019-05-21 00:05:22 +00:00
Guillaume Revaillot
ee376eafdb
stm32g0: make doc.
2019-05-21 00:05:22 +00:00
Guillaume Revaillot
55121126c3
stm32g0: add exti.
...
Regular exti, with enhanced EXTI_[FR]PR regs instead of EXTIR_PR.
2019-05-21 00:05:22 +00:00
Guillaume Revaillot
afd2db3097
stm32g0: add rcc.
2019-05-21 00:05:22 +00:00
Guillaume Revaillot
cbe5425090
stm32g0: add flash.
...
here, it's a bit of a mess.. G0 flash controller does not really
match exsting feature split. IE it has instruction cache only ..
so, no flash_idcache.c as it. flash_common_f could be used, but
flash_unlock would not take care of option byte ?
prefetch, icache and lock is ok. I had no look at flash programming
or erase yet..
2019-05-21 00:05:22 +00:00
Guillaume Revaillot
f13a9eee5b
stm32g0: add power.
...
neither v1 nor v2...
2019-05-20 23:59:42 +00:00
Guillaume Revaillot
c49937a09c
stm32g0: add gpio.
...
regular peripheral.
2019-05-20 23:43:46 +00:00
Guillaume Revaillot
b8d4b03722
stm32g0: add base, irqs, memorymap and current devices.
2019-05-20 23:43:41 +00:00
Karl Palsson
8a952d8476
gd32: drop commit of generated code
2019-05-19 21:39:46 +00:00
Oliver Meier
82d2ff9d1a
stm32f4-7: dma2d: fixed wrong color definition and added missing one
2019-05-19 21:33:07 +00:00
Oliver Meier
07868ad8b6
stm32f7: enable existing dma2d headers
2019-05-19 21:33:07 +00:00
Oliver Meier
82498bb49f
stm32f7: fixed typos in dsi header definitions
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
Matthew Lai
c801a7ffec
stm32f7: Rename USART7/8 to UART7/8.
...
Matches the existing irq names and the reference manual correctly.
2019-05-19 20:43:57 +00:00
Karl Palsson
888fee1409
stm32l1: adc: use the new v1-multi headers.
...
This drops a lot of now common definitions. This is still just
prepratory work before using the v1-multi code itself.
2019-05-10 22:35:10 +00:00
Karl Palsson
c858a1e5f5
stm32: adc-v1m: extract some portions back to f4/f7.
...
While this appears to be a backward change, this moves the _register_
definitions (their addresses) and the actually specific to f4/f7
numbering back into the explicit headers. Potentially this could be
pulled out again, but it's not much code.
This then allows the stm32l1 to use all the rest of this code, with the
differences really being just the addresses of the registers.
2019-05-10 22:30:31 +00:00
Karl Palsson
7076619dd7
stm32: adc-v1m: drop lots of noisy useless defines.
...
Never seen any reason for these noisy verbose defines. They're not
helpful, and we've never needed them for doing sequence setting code
anyway. Just drop them.
2019-05-10 22:27:20 +00:00
Karl Palsson
53c6e617b5
stm32: adc-v1m: tightenup definitions
...
Use the masks and shifts defined. common style.
2019-05-10 22:20:29 +00:00
Karl Palsson
45e14a7bd3
stm32: adc: fix f4/f7 temperature sensor channel defines.
...
Lots of common stuff, but the F7 fixed the temperature sensor randomness
that the f4 had. Separate the definitions properly.
2019-05-10 22:18:08 +00:00
Karl Palsson
cc364d1ac2
stm32: adc-v1m: fix include guard
2019-05-10 22:16:33 +00:00
Matthew Lai
0a3e1cc0e6
Renamed adc_common_v3 to adc_common_v1_multi
2019-05-09 11:54:19 +00:00
Matthew Lai
6703abf5e3
Added F7 ADC support (almost the same as F4)
2019-05-09 11:54:19 +00:00
Karl Palsson
ca43a73ea3
stm32: dac: move DAC_SR to common.
...
It's available on f0, f2, f3, f4, f7, l0, l1 and l4.
Just note that it's not available on f1.
2019-05-09 11:49:25 +00:00
vector
486446e1db
STM32F4-7: add DAC_SR status bits
...
Include the DAC_SR register and it's bits. Arguably this should be jsut
included in the common_all file.
2019-05-09 11:39:44 +00:00
vector
5dbdb255d8
STM32F7: dac: include in build.
...
Based on F4.
2019-05-09 11:34:16 +00:00
Marek Koza
e50ce6a876
stm32l4: Correct memorymap and add the existing CAN library
2019-04-30 20:47:14 +02:00
Ross Schlaikjer
4fb67d891f
stm32f7: enable existing ethernet libraries
2019-04-15 13:11:05 +00:00
Ross Schlaikjer
395c024458
stm32f7: enable existing syscfg headers
2019-04-15 13:10:48 +00:00
Ross Schlaikjer
a92a44a7c2
stm32f7: enable existing CRC support
2019-04-15 13:10:37 +00:00
Ross Schlaikjer
0173ecec9c
stm32f7: enable existing IWDG support
2019-04-15 13:10:21 +00:00
Karl Palsson
72a7284355
doc: hook up gd32f1x0 documentation
...
Super easy now thanks to the earlier changes.
2019-04-15 13:06:48 +00:00
Ross Schlaikjer
4db40e0839
stm32f7: Include i2c_common_v2
...
With the addition of a define for I2C4, the existing common i2c
functions seem to work out of the box on the F7 (tested on an
STM32F750).
2019-04-04 22:11:20 +00:00
Icenowy Zheng
330d5fd5be
gd32: add new chip series f1x0
...
GD32F1X0 (X can be 3, 5, 7 and 9) is a series of Cortex-M3 MCUs by
GigaDevice, which features pin-to-pin package compatibility with
STM32F030 MCU line. F150 adds USB support to F130, and F170/F190 adds
CAN support.
Currently the code mainly targets GD32F130 and F150 chips. Some register
are different between F130/150 and F170/190, just like the difference
between STM32F1 Performance line and Connectivity line.
From the perspective of registers and memory map, GD32F1X0 seems like a
mixture between STM32F1 and STM32F0 (because it is designed to be
pin-to-pin compatible with F0, but with Cortex-M3 like F1). A bunch of
code are shared between STM32 and GD32, and these code are specially
processed to include the GD32 headers instead of STM32 headers when meet
GD32F1X0.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
gd32/rcc.[ch] are forks of stm32f1/rcc
gd32/flash.[ch] are forks of stm32f0/flash
No attempts at deduplicating this have been done at this stage. We can
see where they move in the future.
2019-04-03 12:53:33 +00:00
ALeX Kazik
8064f6d0cb
stm32f4: fmc: add missing DECLS wrappers
...
Function prototypes need DECLS wrappers for inclusion in c++/asm
2019-01-31 09:59:59 +00:00
Guillaume Revaillot
553c876fa5
stm32: exti: define AFIO/SYSCFG_EXTICR_FIELDSIZE for all chip.
...
While on all current chips, exticr gpio port mux selection is coded on 4 bits,
stm32g0 EXTI_EXTICR register uses 8 bits. Align all exti header to reference
that value (was previously defined for f0 as SYCFG_EXTICR_SKIP)
2019-01-31 09:57:43 +00:00
Guillaume Revaillot
7afd86db30
stm32l[01]: flash common: add flash_unlock_acr, allowing to unlock FLASH_ACR RUN_PD bit.
...
flash_unlock_acr allows to unlock RUN_PD bit from FLASH_ACR register. Relock is done automatically
when writing 0 to RUN_PD, so no flash_lock_acr method.
2019-01-31 09:35:55 +00:00
Guillaume Revaillot
ff9664389b
stm32: exti: move register definition of all current stm32 devices to common_v1
...
Preparation for stm32g0 support, as this chip's exti register map evolved and is
no longer common ...
2019-01-18 18:33:55 +01:00
Harold Tay
9cadd60b3c
stm32: rtc: Fixed typo in macro def (RTC_DR_MT_MASK)
2019-01-18 10:32:43 +00:00
Guillaume Revaillot
708fe1516c
stm32: fix nvic channels name to match dma1/2 on stm32f09x
2019-01-18 10:31:32 +00:00
Darrell Harmon
718f86935a
EFM32 I2C: fix base undeclared
...
libopencm3/include/libopencm3/efm32/common/i2c_common.h:234:29: error: 'base' undeclared (first use in this function)
#define I2C0_CTRL I2C_CTRL(base)
2019-01-14 11:51:08 +00:00
Karl Palsson
33387e8f96
stm32f0:adc: add missing declaration
...
fixes: 7e1d3daa
stm32f0: adc: API call to clear EOS flag
2019-01-12 22:19:49 +00:00
Karl Palsson
4edba3111d
common: support inclusion into assembly files
...
Suggested in https://github.com/libopencm3/libopencm3/pull/981
2019-01-11 23:09:27 +00:00
Karl Palsson
ad10e96811
stm32l4:dma: add Channel Selection defines
...
Far from complete support for the channel selection systems on f0/l4,
but at least brings in the defines needed for doing this yourself.
Fixes https://github.com/libopencm3/libopencm3/issues/1001
2018-12-30 21:03:40 +00:00
Alfred Klomp
1adc418f9a
stm32f42/f43: rcc: add 180 MHz clock options
2018-11-12 21:41:05 +00:00
Karl Palsson
8b13977ea0
stm32f0: add DMA1 compatibility alias
2018-11-09 15:34:58 +00:00
Alfred Klomp
b7a9968e4f
fixup! stm32f09: add register definitions for DMA2
2018-11-06 18:48:18 +01:00
Alfred Klomp
a9c0008290
stm32f09: add register definitions for DMA2
2018-11-06 12:58:36 +01:00
Alfred Klomp
53347c266b
stm32f09: add register definitions for USART5..8
2018-11-06 11:35:40 +01:00
Karl Palsson
3af05fb862
stm32f7: spi: fix include error
...
Badly splitting commits.
Fixes: 2619a45
stm32f7: use spi v2 peripheral
2018-10-23 21:43:29 +00:00
Karl Palsson
1883a4311f
msp432: whitespace fixups spaces->tabs
...
whitespace only change.
2018-10-23 21:33:16 +00:00
Dmitry Rezvanov
a63d0499de
msp432/e4: Add GPIO support
2018-10-23 21:21:54 +00:00
Karl Palsson
076cd67530
stm32: spi-v2: Frame format is available for all.
...
All spi v2 peripherals include the Motorola/TI Frame formatting options
introduced with F2.
2018-10-23 21:21:36 +00:00
mfm
f6517f7816
stm32: adc common v2: add circular dma mode
...
Tested only on the F3 so far.
2018-10-20 11:46:47 +00:00
Karl Palsson
bc7e454741
stm32f7: include common dma code
...
Originally reported at https://github.com/libopencm3/libopencm3/pull/978
2018-10-20 11:40:38 +00:00
Guillaume Revaillot
18eadcfda5
stm32: timer_common: add timer21-22, found on stm32l0 chips.
...
stm32l0 devices have tim21 and tim22.
2018-10-06 09:53:54 +00:00
Karl Palsson
239b4a4704
stm32f7: add irqs from latest ref manuals
...
Updated from RM410 rev4, RM0385rev8 and RM0431 rev3
Originally reported at https://github.com/libopencm3/libopencm3/issues/974
2018-10-03 17:12:42 +00:00
Karl Palsson
6b0fd864a1
stm32f7: fix RCC_APB1 defns for USART7/USART8
...
The reset and low power definitions for USART7/USART8 were correct, but
not the primary enable registers.
Fixes: https://github.com/libopencm3/libopencm3/issues/969
2018-09-24 10:35:16 +00:00
Karl Palsson
0d7f1f7708
stm32: f24: dma: clarify stream/channel
...
It's always stream on the "new" dma controller (unless it's channel....)
Fix a couple of inconsistent prototypes that had carried over from f1
originally. Reported by vampi on irc.
2018-09-15 09:27:31 +00:00
Karl Palsson
9ddafa6284
stm32f7: enable common timers support
2018-09-09 16:38:56 +00:00
Karl Palsson
cae295ee2c
doc: cm3/scb+scs: turn on existing documentation
...
Lots of registers were already documented extensively. Turn it all in
doxygen with groups and the right syntax.
2018-09-09 15:27:41 +00:00
Karl Palsson
1ad2cda496
doc: add all cm3 headers to doxygen.
...
Just get them all included as they are. Gets them grouped up and
visible so we can start clarifying the rest of their docs.
2018-09-09 15:27:41 +00:00
Clara Casas
889b7de0d7
stm32: adc: Add functions to get and clear flags
...
This includes adding documentation to the status flags.
Originally tracked at: https://github.com/libopencm3/libopencm3/pull/833
Modified to drop whitespace changes, and simply boolean return.
2018-08-28 22:00:07 +00:00
Daniel Gröber
743513a4b1
stm32: add dma_get_number_of_data
...
Original discussion at: https://github.com/libopencm3/libopencm3/pull/702
2018-08-28 22:00:01 +00:00
Karl Palsson
824beaa472
lm4f: timers: add basic register definitions
...
Add the timers to the memory map and the basic registers at least.
2018-08-28 13:26:11 +00:00
Florian R. Hölzlwimmer
f3c620b51b
stm32f7: spi: include common code
2018-08-27 22:57:28 +00:00
Karl Palsson
22754f0919
usb: provide lm4fusb driver reference
...
We provided references for all the others, provide it for the lm4f
driver too.
2018-08-27 15:11:32 +00:00
David Lamparter
ebcf197810
usb: make usb_disconnect() weak
...
usb_disconnect() is board/platform specific for chips that don't have
built-in handling for this. Allow the application to provide its own
version of usb_disconnect() to handle this.
See https://github.com/libopencm3/libopencm3/pull/924
2018-08-27 15:11:32 +00:00
David Lamparter
343cff4675
usb: make strings "const char * const *"
...
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"
See https://github.com/libopencm3/libopencm3/pull/924
2018-08-27 13:34:52 +00:00
Karl Palsson
fa7a908027
doc: msp432/e4: Fix groupings for doxygen
...
Proper closing tags, an outer grouping, and don't refer to missing
groups.
2018-08-27 13:34:40 +00:00
Dmitry Rezvanov
2adefd95fe
msp432/e4: new target
...
Basic memory map and system control.
Originally tracked via: https://github.com/libopencm3/libopencm3/pull/946
2018-08-27 13:34:29 +00:00
Karl Palsson
0c91dbf57e
cm3: scs: drop (superseded) helper macros for systick
...
These are superseded by cm3/systick.h and the functions there.
Reported originally under: https://github.com/libopencm3/libopencm3/issues/125
2018-08-21 21:20:57 +00:00
Karl Palsson
cfe514913f
cm3: scs: drop (superseded) dwt macros
...
They are all superseded by dwt.h, and the function dwt_enable_cycle_counter
Fixes https://github.com/libopencm3/libopencm3/issues/125
(But only for the cycle count enabling)
2018-08-21 21:20:51 +00:00
Karl Palsson
6fa75afbc6
usb: add USB_REQ_TYPE_OUT to match USB_REQ_TYPE_IN
...
#defines are free.
Fixes https://github.com/libopencm3/libopencm3/issues/515
2018-08-20 23:53:07 +00:00
Jordi Pakey-Rodriguez
21b23f1ff1
stm32f4: adc: Add VBat sensor enable/disable
...
Original discussion at: https://github.com/libopencm3/libopencm3/pull/770
2018-08-19 23:26:04 +00:00
Karl Palsson
0787675332
st32l1: adc: there is no adc_chan_vbat on L1x.
2018-08-19 23:26:04 +00:00
Karl Palsson
0e58ee2f65
stm32: support i2c3 properly
...
I2C3 is on many parts, but wasn't properly supported with the register
definitions. Declare them centrally, just depending on the memorymap
defining them. On some parts, the rcc bits were defined, but not the
base registers.
Fixes: https://github.com/libopencm3/libopencm3/issues/820
2018-08-17 00:15:01 +00:00
Karl Palsson
b8ede60d9d
stm32f3: flash: support basic write/erase operations
...
Originally filed as https://github.com/libopencm3/libopencm3/pull/627
2018-08-17 00:15:01 +00:00
Karl Palsson
3293913be2
stm32f3: flash: add clear write protect flag
...
Could actually move to flash_common_f, but they have different names for
the same bit at present.
2018-08-17 00:15:01 +00:00
Karl Palsson
f4bbe7c5bb
usb: prevent registering duplicate config callbacks
...
Originally discussed at https://github.com/libopencm3/libopencm3/pull/722
2018-08-17 00:15:01 +00:00
Karl Palsson
49a8c041ff
stm32f3: comparator: fix doxygen and use standard mask/shifts
...
Convert to standard style of unshifted field values.
2018-08-17 00:15:01 +00:00
Markus Kasten
0d0f59d8ce
stm32f3: add comparator register definitions
2018-08-17 00:15:01 +00:00
Chris Sp
8b1ac585df
stm32f4: rcc: typo fix MCO2
...
Just a small typo I came across while trying to get MCO to work on my board.
The define is not used in any other files as far as I can tell, but of
course applications might break if they use the misspelt variant.
2018-08-07 15:12:58 +00:00
Karl Palsson
ddc7ab8c6c
stm32l4: flash: don't use misleading names
...
flash_clear_pgperr_flag is a name used on f247, which is actually most
analogous to the SIZERR bit on l4, (it's a parallelism error)
the bit being cleared originally in this function, PROGERR is a new bit,
and should have it's own name.
Add a function to handle the previously unhandled size/parallelism flag,
and rename the existing one to properly reflect it's new name.
2018-07-29 20:31:17 +00:00
Karl Palsson
659d52b952
stm32f7: flash: drop unimplemented function declaration
...
flash_art_disable was never implemented, and isn't really a super useful
function anyway, so just drop the decl, rather than implementing it.
2018-07-29 20:31:17 +00:00
Karl Palsson
231f21296f
stm32: f247: flash: use common code.
...
This shows what is _actually_ different for f7. A couple of option
bits, and a renaming of bit 7 of the status register, from Program
Sequence Error to Erase Sequence Error.
We keep the separate implementation of wait_for_last_operation, to meet
the "suggestions" of the reference manual to insert a DSB instruction.
Keeping the renamed bit/functions also requires us to keep separate
implementations of the flag clearing functions
2018-07-29 20:31:17 +00:00
Karl Palsson
76d392ee47
stm32: flash: drop common_f234
...
Move the last few register defines back to their relevant headers, add
doxygen and groups. While these registers _were_ "common" they were the
_only_ common things, so it's simpler for future work (merging f7 with
f2/4) to move them back separately.
2018-07-29 20:31:17 +00:00
Karl Palsson
eafc46ff24
stm32: flash: extract wait_for_last_operation to top level
...
This then eliminates the misguided attempts at merging f2/4 and f3 flash
support. Some headers remain.
2018-07-29 20:31:17 +00:00
Karl Palsson
c272ea410e
stm32: flash: move clear all status flags to single common header
...
We've got a "f" flash file for common apis now, use it.
2018-07-29 20:31:17 +00:00
Karl Palsson
a949b223c3
stm32f3: flash: pgerr is not the same as pgperr
...
F3's flash interface is actually quite different, don't try and force
sharing code that isn't really related. The "PGERR" is a very different
bit than the parallelism error that f2/4/7 have.
2018-07-29 20:31:17 +00:00
Karl Palsson
b9448bff16
stm32l4: flash: fix page erase for second bank
...
l4 is pages, not sectors, so update apis to be consistent. (other
families use page/sector as defined in the reference manual)
Make sure that pages on the second bank can also be erased. Use the
same style in use for f2/4/7 for sector numbers across banks.
2018-07-29 20:31:17 +00:00
Karl Palsson
850931dbcd
stm32: flash_unlock_option_bytes is common code.
...
The keys differ between some familes, but the documentation and
implementation are standard.
2018-07-29 20:31:17 +00:00
Karl Palsson
c5a3350a7d
stm32l: flash: rename option unlock keys or consistency
...
Paves the way for using common code.
2018-07-29 20:31:17 +00:00
Karl Palsson
7a27795d8c
stm32: flash: pull out i/d cache support.
...
Copied a few times.
2018-07-29 20:31:17 +00:00
Karl Palsson
2bf7eb4a0c
stm32: flash: pull set_ws up to common code
...
All that changes is the size of the field.
2018-07-29 20:31:17 +00:00
Karl Palsson
4840b6bc7e
stm32: flash: pull up clear_eop
...
All the "f" type flash parts have an EOP flag, even if it's in different
bit positions. Add a header for this common functionality, and move
it's implementation to the existing common file.
2018-07-29 20:31:17 +00:00