30 Commits

Author SHA1 Message Date
Guillaume Revaillot
bcfdcc09ac stm32g0: add syscfg header. 2019-11-25 20:49:20 +00: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
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
ec597796d7 stm32g0: fix bad typos in memorymap, impacting tim1 and tim15-17. 2019-08-27 16:24:42 +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
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
Karl Palsson
7c0320bf21 doc: stm32g0: rcc: add groupings for periph resets 2019-06-12 23:06:22 +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
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
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