883 Commits

Author SHA1 Message Date
Karl Palsson
7da29d3d5f stm32: desig: doc: merge duplicate documentation sections
Use the best one.
2020-01-28 23:03:39 +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
64baacfbbf rng: add irq enable/disable helper. 2020-01-05 00:24:43 +00:00
Jacob Walser
e2ac1a6358 stm32f3: bugfix + adjust wwdg threshold signatures to support 12 bit resolution
- these registers are 12 bits wide
- bugfix clearing thresholds so that both upper and lower thresholds can be
  configured on the **window** watchdog
2020-01-05 00:10:12 +00:00
Jacob Walser
854da9635e stm32f0: adjust wwdg threshold signatures to support 12 bit resolution 2020-01-05 00:08:48 +00:00
Jacob Walser
5409ce73bd adc_common_v2: bugfix ADC_xT1_VAL(x)
mask out bits that must not be written
2020-01-05 00:08:48 +00:00
Karl Palsson
18f4d7c1b7 stm32f3: rtc: include correct shared header
rtc_common_all never existed, and f3 has the same "v2" peripheral used
by ~all parts other than the f1.  We don't have any f3 rtc test code,
but the existing code was clearly wrong, and this is at least including
the correct basic defines.

Fixes: https://github.com/libopencm3/libopencm3/issues/1106
2020-01-04 23:13:08 +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
Karl Palsson
aabd4da3c0 stm32g0: syscfg: doc: fix missing grouping 2019-12-25 20:43:02 +00:00
Guillaume Revaillot
87dbf40cde stm32g0: rcc: group rcc_registers and registers values 2019-12-25 20:34:11 +00:00
Guillaume Revaillot
48afe3ca67 stm32g0: flash: fix wrong comment. 2019-12-25 20:34:11 +00:00
Guillaume Revaillot
ebd265ce42 stm32g0: rng: typo in header. 2019-12-25 20:34:11 +00:00
Guillaume Revaillot
070058f80c stm32: adc: doc fix
declare chselr group in v2 single header, where adc_chselr reg is declared
2019-12-25 20:34:11 +00:00
Guillaume Revaillot
e7c8f18f7c stm32: adc: group adc_registers 2019-12-25 20:34:11 +00:00
Karl Palsson
86b4cf6787 stm32h7: fix typo in doxygen description 2019-12-25 20:30:17 +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
Mathias Nord
9af9a1dbfa stm32g0: use spi v2 2019-12-03 14:45:47 +01:00
Karl Palsson
af384dbc7c doc: fix some broken groups uncovered while reviewing h7 code 2019-11-28 22:16:54 +00:00
Karl Palsson
af8a1773b7 stm32h7: doc: fix some missing group definitions 2019-11-28 22:16:34 +00:00
Brian Viele
53302439df stm32h7: Initial introduction into libopencm3.
Updates to a base set of includes to map to the h7 include files which are
mainly based on the f7 versions for simple devices (e.g. SPI, USART, GPIO).

Custom files that have been implemented from the datasheet/ref manual include
the memory map, RCC, PWR definitions, and irq.json file for generation of
nvic files for interrupt mapping.

Additional functionality, especially PLL and tweaks for non-F7 compatible
implementations coming in future commits.

Added documentation tree configuration.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
Changed dmaX_streamX to dmaX_strX in a few places for consistency
2019-11-28 22:15:24 +00:00
Guillaume Revaillot
bcfdcc09ac stm32g0: add syscfg header. 2019-11-25 20:49:20 +00:00
larchuto
0a68b012a1 stm32l4: Fix typo impacting uart4 and uart5 2019-11-21 18:59:32 +01:00
Guillaume Revaillot
38b45c8786 stm32g0: add adc.
v2 "single" peripheral with a couple of tweaks :
 - added registers to configure two additionnal advanced analog watchdog.
 - different adc sampling time time based on channel groups.
 - 8 steps adc sequence injection, using chselr/chselrmode.

And a note on the rm explaining that after every configuration change to ADC_CFGR1's
SCANDIR or CHSELRMOD or CHSELR register, user need to check that configuration
is applied before any other modification / adc conversion start.. making adc_set_reqular
a bit painfull to read..
2019-11-08 14:19:17 +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
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
Karl Palsson
7a27397b9e stm32: rtcv2: don't shift the "month tens" bit
None of the other masks are shifted, don't shift this field either.

Fixes: https://github.com/libopencm3/libopencm3/issues/1123
2019-11-06 19:45:20 +00:00
Bryan PEREIRA
1fbfdecb17 stm32f3: Add SPI4 BASE 2019-10-16 14:41:00 +00:00
Nicholas Rossomando
77d96a3430 stm32l0: crc: enable common code 2019-10-12 14:11:39 +00:00
Jonathan Halmen
ec2d96433f stm32f4: rcc: add plli2s config function 2019-09-27 13:55:56 +00:00
Jonathan Halmen
203d0ca295 stm32f4: rcc: remove unnecessary pllsai functions
existing standard functions for these are
 * rcc_osc_on(RCC_PLLSAI);
 * rcc_is_osc_ready(RCC_PLLSAI);
2019-09-27 13:43:06 +00:00
Guillaume Revaillot
8a1cfa8ceb stm32g0: use proper register for gpio peripheral clock sleep enable.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-08-28 20:54:35 +00:00
Guillaume Revaillot
998e647dde stm32g0: memorymap: get rid of apb1/apb2 reference, device only has one apb.
I apparently based memorymap.h on previously written header without noticing
that g0 has only one apb despite a big hole in the memory space and addresses
matching usual apb1/apb2 split..
2019-08-28 12:03:55 +02:00
Guillaume Revaillot
562dca7358 stm32f4: doc: f4 are cortex m4f based 2019-08-28 01:41:14 +00:00
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
1964fd72f2 doc: stm32f3: adc: register base addresses had landed outside a group 2019-06-25 21:15:35 +00:00
Karl Palsson
f63145db07 doc: stm32f7: rcc: add missing top level groups 2019-06-25 21:15:19 +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