Commit Graph

1530 Commits

Author SHA1 Message Date
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
Karl Palsson da7ebafcbe stm32: flash: pull lock/unlock up to common_f.
This is a common operation, so definition in _all, and every part except
l0/l1 have the same implementation.  Bring in an _f file too.
2018-07-29 20:31:17 +00:00
Karl Palsson b23dccc7ae stm32: flash: pull up prefetch to _all
Turns out, there's lots of common code for flash.  Pull up prefetch
on/off to start with, as there's only a single bit name different.

Pull up the definitions of common API functions too, starting with
flash_set_ws.  Even if the implementations are different, things that
meant to be the same, should be defined centrally.
2018-07-29 20:31:17 +00:00
Karl Palsson 9dd901ba27 stm32: flash: BSY bit has never been writable.
This has been copied around for years, but has never been a writable bit
on any target.
2018-07-29 20:31:17 +00:00
DanielePettenuzzo 6e1edc3656 stm32f7 usart.h: add macro for usart6 and uart 7 and 8 2018-07-29 20:31:17 +00:00
Jordi Pakey-Rodriguez cc8c8a2f83 stm32f4: power: update rcc_clock_scale enum
- Change .power_save to .voltage_scale, a pwr_vos_scale enum
- Enable pwr clock before setting VOS scale
- Fix flash wait states
- Make flash_set_ws more robust
2018-07-29 20:31:17 +00:00
Karl Palsson e076c3cadd doc: stm32: rtc common v2: convert comments to doxygen
Grouping and making the existing comments doxygen friendly
2018-07-29 20:31:17 +00:00
Alexey Ryabov 22f7348b89 stm32: rtc: add missing definitions 2018-07-29 20:31:17 +00:00
Karl Palsson 33ef6fd816 stm32f3: rcc: fix extern name for hsi structs
Fixes: ab9e425272
2018-07-29 20:31:17 +00:00
keepkeyjon f53e12d2da cm3: Only inline asm is allowed in naked functions
According to: https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/ARM-Function-Attributes.html

"Only basic asm statements can safely be included in naked functions (see Basic
Asm). While using extended asm or a mixture of basic asm and C code may appear
to work, they cannot be depended upon to work reliably and are not supported."
2018-07-29 20:31:17 +00:00
Matt Anderson 0d5e51a8a7 STM32F0: Add RCC API for I2C1 clock source
* Providing API to set/clear RCC_CFGR3_I2C1SW on STM32F0, duplicated
	from STM32F3 applies only to I2C1.
2018-07-03 22:30:24 +00:00
Matthew Lai 68fce5a0ab stm32f7: rcc: fixed wrong constants, added more settings, clock setup refactoring 2018-07-03 22:23:00 +00:00
Matthew Lai ba0e0424b5 stm32f7: flash: added proper support 2018-07-03 22:23:00 +00:00
Karl Palsson ab9e425272 stm32f3: rcc: add hse preconfigurations
Just a single 8Mhz in, 72mhz (max) out, which suits the f3 discovery
boards for instance.
2018-07-03 22:23:00 +00:00
Karl Palsson ee8b5bf4ac stm32f3: rcc: drop useless 44MHz clock structure.
This clock speed is not USB compatible, it's not the maximum for
anything, nor the minimum, it's just a distraction.  Drop it.
2018-07-03 22:23:00 +00:00
Chuck McManis 1e9a2e641c stm32F4: LTDC - bit defines without semantics
The LTDC include file was defined with combined bit
semantics and bit position. As a result instead of
LTDC_GCR_VSPOL which is the bit which defines vertical
sync polarity, this had been defined to be
LTDC_GCR_VSPOL_LOW (0) and LTDC_GCR_VSPOL_HIGH (non zero).
This sort of define makes it impossible to know ahead of
time what operation would set or reset the bit (some are
negative logic, others are postive logic, so affirmative
defines could mean either "set the bit" or "reset the bit"
I've added the non-semantic bit define so that it is clear
in my code if the bit is being set or reset.

Discussion took place at https://github.com/libopencm3/libopencm3/pull/889
2018-07-03 22:23:00 +00:00
Karl Palsson 034dbf20ff stm32: timers: drop deprecated timer_reset()
We didn't actually mark it deprecated very well, but it was
non-functional, and simply a poorly implemented wrapper for
rcc_periph_reset_pulse() anyway.

It's now been obsoleted in the examples for more than a year, and it's
time to kill it outright.

Fixes: https://github.com/libopencm3/libopencm3/issues/709
2018-07-03 22:23:00 +00:00
Sebastian Holzapfel dfc67c03dc usb audio: add descriptors for streaming feature units 2018-07-03 22:23:00 +00:00
Martin Sivak 572a50a53c stm32l0: include rtc module 2018-07-03 22:23:00 +00:00
Karl Palsson b47b967440 doc: use common naming for peripheral apis
Only applied to STM32 doc trees at present.

Instead of declaring a group for "STM32blah" in the doc-blah.h files,
and then trying to put all the common+specific peripheral code into
those groups, (which is what led to the stub doxygen holder empty .c
files)  Just use a standard name like "Peripheral APIS" and place
everything into that.

Demonstrated by converting ADC and USART peripherals, which is
definitely not complete, but it shows how to make things less magical,
and less prone to copy/paste errors.  Now, you can copy/paste and it
will do the right thing, because everyone uses the same group names.

This is also how to unify the mix of "STM32blah->Periphblah" and _also_
the dangling "periph_file" modules in doxygen, it merges them together
properly, as they're intended to be really.
2018-07-03 22:23:00 +00:00
Karl Palsson 2352d5d1fb stm32: i2c-v2: Fix typo in CR1_ADDRIE
Reported in: https://github.com/libopencm3/libopencm3/issues/925
2018-06-07 12:01:11 +00:00
Karl Palsson 2204f447bb BREAKING: stm32f3:rcc: add more generic pll setup routines
Deprecate the old routine and make a new one that actually handles HSI
and HSE properly, and includes the predivider and the usb divider
settings as well.
2018-05-01 22:23:44 +00:00
Karl Palsson 622475f543 BREAKING: stm32f3:rcc: use more common MUL names
Make the defines as they are on other families, try and make more
defines the same, not arbitrarily different.
2018-05-01 22:19:28 +00:00
Karl Palsson ef44bdd09e BREAKING: stm32f0/f1: standardize flash_prefetch_xx
use the same API on all families, flash_prefetch_{enable,disable}()
2018-05-01 22:19:28 +00:00
Karl Palsson 389ec82538 stm32f3: flash: add prefetch helpers
Should be added to f2/f4 as well, but the bit definitions are different.
2018-05-01 22:19:28 +00:00
Martin Sivak f0e128673d Add DMA support to STM32L0
STM32L0 uses the same DMA peripheral as STM32F0, F1, L1 and others
with some differences. Those are mostly in the number of supported
controllers and channels.

This patch enables the basic support with no attempt to only expose
the available controllers / channels.

For more information see the ST Application Note AN2548.

Signed-off-by: Martin Sivak <mars@montik.net>
2018-04-29 19:22:13 +00:00
Guillaume Revaillot 54c6c833fe stm32: stm32f09x has two independent dma controlers, add RCC bits. 2018-04-29 13:16:36 +00:00
Guillaume Revaillot bf125e91f9 stm32: rework spi, based on PR #740 and #742.
split spi stuff in three part:
 - v1 : basic spi peripheral
 - v1_frf : v1 spi with frf mode additional bit in spi_cr2 / spi_sr
 - v2 : spi with variable datasize, fifo and other fancy stuff.

v1 maps to f1 chips
v1_frf to f2, f4 and l0,l1
v2 to f0, f3 and l4

This breaks spi_master_init API for v2 devices : function prototype from
common spi header used to be abused, with DFF bit reused for CRCL bit.
New v2 spi_master_init does not handle anymore CRCL bits, as it does not
usually mess with other crc configuration.
2018-04-28 21:12:27 +00:00
Karl Palsson 34462ac54a stm32: adc v2: add some minor doxygen 2018-04-28 21:12:27 +00:00
Vegard Lillevoll 41cad7c065 stm32: adc-v2: Add ADC_CFGR1_AUTOFF 2018-04-28 21:12:27 +00:00
Vegard Lillevoll bbe71b4c4f STM32F0: Added ADC1_CCR definition 2018-04-28 21:12:27 +00:00
Karl Palsson 64c5535693 stm32l0: adc: add sample time definitions 2018-04-28 21:12:27 +00:00
kbob e8154aa44a efm32: Add EZR32WG "EZRadio Wonder Gecko" family. 2018-04-27 21:37:03 +00:00
kbob c3889b91df efm32: Add EFM32WG "Wonder Gecko" family. 2018-04-27 21:37:03 +00:00
kbob 5160d7996c efm32: Split efm32/lg into /lg and /common.
Somewhat replaces some earlier work done by hg/lg, but much more
complete, so we kept it as is, because it's bringing in even more parts
after this.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2018-04-27 21:36:42 +00:00
Karl Palsson 6675be5326 efm32: cmu: lh/hg fix AUXHFRCOCTRL values
Applies to both, and clearly shows that cmu.h needs to be extracted as
common code.

Originally from: e31d312331
and checked in the HG/LG reference manuals.
2018-04-14 18:40:54 +00:00
kbob 0d815061d9 efm32lg: adc: Misspelling in ADC_CTRL_LPFMODE definition. 2018-04-14 18:40:54 +00:00
kbob 90ea97c3e5 efm32lg: Fixed BURTC_CTRL_LPCOMPC_IGNxLSB definition. 2018-04-14 18:40:54 +00:00
kbob 74316e6901 efm32lg: acmp: Fixed ACMP_CTRL_HYSTSEL_HYSTx definition. 2018-04-14 18:40:54 +00:00
Maxim Sloyko 2b1ddc8490 sam/4l: monster commit
The original submitter of this squished everything into one series, and
has not returned. The code mostly appears good, and review comments were
followed for the most part.  The project doesn't really maintain any
testing or board farm for sam3/sam4 parts, so we're going to just trust
our users.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>

sam/4l: IRQ Configuration file (irq.json)

sam/4l: Basic Memory Map.

sam/4l: GPIO Defines.

sam/4l: GPIO Functions

Added everything that needed to compile the library: Makefile, Linker
Script and common includes.

sam/4l: SCIF function to start OSC.

sam/4l: GPIO Enable/Disable and Multiplexing configuration functions.

sam/4l: PLL Clock configuration.

sam/4l: Peripheral clock configuration and basic USART support.

sam: USART Character length configuration.

sam/4l: Generic Clock configuration functions.

sam/4l: Analog to Digital Converter Interface (ADCIFE) basic support.
2018-04-14 18:40:54 +00:00
Karl Palsson 23fc65d44c ethernet: ksz80x1: fix build/compile
Originally sourced from: https://github.com/libopencm3/libopencm3/pull/382

fixed some typos from the manual and poor merging/rebaseing,
and one judgment call on using a specific name for a conflicting
bit definition.
2018-04-14 18:40:54 +00:00
Frantisek Burian 20b7956d82 [ETH/PHY] Add support for Micrel KSZ80X1 family of PHYs 2018-04-14 18:40:54 +00:00
Karl Palsson 6e65170390 cmsis: add new families to dispatch handlers.
Some people use the opencmsis headers.  Update them to include all the
recently added targets.

Fixes: https://github.com/libopencm3/libopencm3/pull/907
2018-04-13 11:15:32 +00:00
Karl Palsson 297a51a27e stm32: iwdg (v2) Update doxygen
Turn the existing comments into doxygen comments to get more value
2018-03-28 13:23:22 +00:00
Karl Palsson cab07c0703 stm32: iwdg: fix Window Register name
The f0 copy of this file originally had a copy/paste error in the
documentation.  F3 and L4 had the "right" name.
2018-03-28 13:17:39 +00:00
Guillaume Revaillot c670bdca1a stm32l0: enable iwdg 2018-03-28 13:06:57 +00:00
Guillaume Revaillot 207eb07d4c stm32: centralize additionnal iwdg window register definition into iwdg-v2.
stm32f0, l3, l4 are currently sharing the same duplicated header, and
stm32l0 uses the same peripheral. Stop copy-pasting stuff and centralize
definitions into a iwdg_common_v2.h header.
2018-03-28 13:06:57 +00:00
Guillaume Revaillot b79de32e9e stm32: iwdg: fix typo in (unused) register name 2018-03-27 18:35:23 +02:00
Karl Palsson fb28b4cb7c stm32f1: bkp: include in doxygen output
The original author had included nice descriptions, so only a tiny bit
of massaging to get it all in doxygen nicely too.
2018-03-08 10:57:50 +00:00
Karl Palsson 6b40e9777e stm32f1: bkp: fix typo in CR_TPAL register
Even original documentation had the full TPAL matching the ref man bit
descriptions.

Reported-by: _ami_ on irc.
2018-03-08 10:56:45 +00:00
Karl Palsson 7bd7d48408 stm32l0: add all new IRQs from later families 2018-03-08 09:52:21 +00:00
Guillaume Revaillot 1ab0d2445f stm32l0: NVIC: channel 16 is tim3 on stm32l0x0, stm32l0x1 and stm32l0x2.
tim3 interrupt is wired to nvic channel 16 if present.
2018-03-08 10:25:34 +01:00
Karl Palsson 1379ab4777 stm32l4: enable common exti functionality
tested on l476 disco board.
2018-03-04 00:02:44 +00:00
Karl Palsson 8feb711ca0 stm32l0:rcc: add rcc_set_pll_source() as per L1
reported by: kaeipnos in https://github.com/libopencm3/libopencm3/pull/609
2018-03-02 22:42:05 +00:00
Frantisek Burian 28aa1e57e9 [ETH/PHY] Add support for STE100 PHY used on some boards from ST 2018-03-02 22:42:05 +00:00
Frantisek Burian 67c2f19d19 [ETH/PHY] Add support for LAN87XX family of PHYs 2018-03-02 22:42:05 +00:00
Frantisek Burian c2c2ac766b [eth/phy] Updated style 2018-03-02 22:42:05 +00:00
Karl Palsson 54b117c5a5 usb: Use enumerated return codes
The enum usbd_request_return_codes has been available for some time.  It
should be used internally, not just by users of this code.
2018-03-02 22:42:05 +00:00
Karl Palsson 93cf76b9d1 stm32l1: syscfg: add USB pullup control definition
On original stm32l1s, this internal pullup was out of spec, and not
recommended for use.  But the -A parts have this fixed, so make sure we
can use it.
2018-03-02 22:42:05 +00:00
Sebastian Holzapfel 995d19ebfd efm32hg: usb: add usb support 2018-03-02 22:42:05 +00:00
Sebastian Holzapfel a2ee90fbfe usb: stm32fx07 -> usb_dwc_common
The stm32fx07 is common DesignWare IP, used in both STM32 and EFM32 chips.
Rename the files to make this more clear, and easier to use in other
targets.
2018-03-02 22:42:05 +00:00
Sebastian Holzapfel 3c855e75d1 efm32hg: cmu: add updated cmu implementation based on efm32lg 2018-03-02 22:42:05 +00:00
Sebastian Holzapfel 18f64812eb efm32hg/lg: timer: use common timer implementation 2018-03-02 22:42:04 +00:00
Sebastian Holzapfel b0fdbe2aea efm32hg/lg: wdog: use common wdog implementation 2018-03-02 22:42:04 +00:00
Sebastian Holzapfel c6296a4d88 efm32hg/lg: gpio: use common gpio implementation 2018-03-02 22:42:04 +00:00
Sebastian Holzapfel fd28881559 efm32hg: add memory map 2018-03-02 22:42:04 +00:00
Sebastian Holzapfel a86948ec6e efm32hg: add basic makefile, interrupts, device information 2018-03-02 22:42:04 +00:00
Christian Tacke a1264f5065 stm32l4: usart: Fix USART3 definition/typo
USART*3* should point to *3* not *2*.
2018-02-26 12:53:42 +00:00
Bruno Randolf ec748dc895 stm32:l4: Add SYSCFG definitions
From RM0394 and RM0351
2018-02-13 23:57:43 +00:00
Bruno Randolf b438edf45d stm32:l4: Add SPI
Same as F3, tested
2018-02-13 23:57:43 +00:00
Bruno Randolf 075ef82a4b stm32:l4: Enable USB FS support
Reviewed against RM0394 and tested with STM32L433CC.
Aparently some other L4 have USB OTG.
2018-02-13 23:57:42 +00:00
Bruno Randolf de39ab1584 stm32:l4: Add CRS
Reviewed against RM0394, untested
2018-02-13 23:57:42 +00:00
Bruno Randolf 2dd4655aed stm32:l4: rcc: Add CLK48SEL HSI48
This is not NONE on the L4 but HSI48.

Reviewed against RM0394 and RM0351.
2018-02-13 23:57:42 +00:00
Bruno Randolf f2c629c4ff stm32:l4: rcc: Add support for HSI48 clock 2018-02-13 23:57:42 +00:00
Bruno Randolf 0cd92c31d6 stm32:l4: Add RTC
Use common, some additional registers missing
2018-02-13 23:57:42 +00:00
Bruno Randolf c90c9fe801 stm32:l4: Add IWDG
Same as F3, reviewed against RM0394, tested
2018-02-13 23:57:42 +00:00
Karl Palsson 55ea31fd04 stm32l4: crc-v2: enable common code
Possible now that the v2 unification code has landed.
2018-02-13 23:57:42 +00:00
Bruno Randolf 7b6710a914 stm32:l4: Add DMA
Same as L1 according to L1-L4 migration guide, untested
2018-02-13 23:57:42 +00:00
Karl Palsson 316c33a6a3 stm32: crc-v2: tweak doxygen output
Make it group better and include labels
2018-02-13 23:57:42 +00:00
Gregory Schlomoff 88ca8058aa ethernet: Add missing BEGIN_DECLS / END_DECLS 2018-02-13 23:57:42 +00:00
Gregory Schlomoff 329b611e4f stm32: ethernet, flash: tagging some function arguments as const 2018-02-13 23:57:42 +00:00
Grigory Revzin 9ef5860863 stm32: can: removed canport argument from can_filter functions 2018-02-13 23:57:42 +00:00
Karl Palsson 0965e691a9 stm32f2/f4: rcc: deprecate old IO definitions
instead of hard breaking, provide them as macros pointing to the new
values, and document them as deprecated.
2018-02-13 23:57:41 +00:00
Yonghua Zheng eeef996cb0 [BREAKING] rcc: change gpio bit defines to be consistent with reference manual
This _breaks_ your gpio code for F2 and F4.  It makes them consistent
with the reference manual, and more consistent with all other families
and general expectations.

OLD code -> NEW code
RCC_AHB1RSTR_IOPxRST 	->	RCC_AHB1RSTR_GPIOxRST
RCC_AHB1ENR_IOPIxEN	->	RCC_AHB1ENR_GPIOxEN
RCC_AHB1LPENR_IOPxLPEN	->	RCC_AHB1LPENR_GPIOxLPEN

[We're not actually breaking it, see the next commit for deprecated
aliases]
2018-02-13 23:57:21 +00:00
Cem Basoglu 34f57ae06e stm32: crc-v2: STM32F0/3 extended crc unit
Implementation of extended crc unit in f0 and f3
2018-02-13 23:57:21 +00:00
Karl Palsson 6580721fd1 doc: stm32 can: fix missing doxygen group 2018-02-13 23:05:21 +00:00
Karl Palsson 67d1a63412 doc: stm32:gpio: fix invalid doxygen
Just reduces more doxygen warnings, and adds more helpful text.
2018-02-13 23:05:21 +00:00
King Kévin 3922cc7d3e STM32: add MASK defines in sdio.h 2018-01-08 11:18:38 +00:00
Karl Palsson ed90df85f0 stm32:i2c-v2: Clarify digital filter setting
Drop redundant field definitions, fix truncation of argument bug and add
documentation.

Fixes: https://github.com/libopencm3/libopencm3/issues/831
2018-01-08 11:16:24 +00:00
WGH f59d47cbd1 docs: usb: clarify usbd_register_control_callback()
Expand notes on when the control callbacks must be registered.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2018-01-04 17:01:48 +00:00
Yonghua Zheng 580a2a4a63 stm32f7: usart: enable usart peripheral
Add usart-v2 to stm32f7 to provide usart support in f7 series.
2017-12-07 10:59:32 +00:00
Karl Palsson ef04708e92 stm32: pwr-v1: doxygen-ize bit definitions.
Rich commentary already existed, just add the second * to let doxygen
pick it up.
2017-12-07 10:33:09 +00:00
Karl Palsson 297d996fa0 stm32f3: pwr: drop duplicate definitions
These definitions were in the already included pwr_common_v1.h file.

And add extra WKUP bit definitions.
2017-12-07 10:33:09 +00:00
Damien Nicolet 19d296dd7b stm32f4: qspi: Typo correction in QUADSPI_ABR 2017-11-16 23:57:11 +00:00
Karl Palsson 368a33773f stm32:l4: usart: add missing header
Fixes: f6796604 stm32:l4: enable usart peripheral
2017-11-10 18:02:14 +00:00
Karl Palsson f67966046a stm32:l4: enable usart peripheral
Tests in https://github.com/karlp/libopencm3-tests/tree/master/tests/uart-basic
2017-10-25 23:54:32 +00:00
Karl Palsson c119ee7f9a stm32:l0: enable usart peripheral
Now that the usart-v2 peripheral is extracted cleanly, adding it for l0
is very simple.
2017-10-25 23:26:52 +00:00
Karl Palsson a23d65e7dd stm32: usart-v2: pull up remaining f3/f0 defns
Final chunk of register definitions to be pulled up.

Now the "target" files are _only_ defining the list of u(s)arts
available, and any _specific_ functions for that target.
2017-10-25 23:03:48 +00:00
Karl Palsson b20d0ff1fb stm32: usart-v2: pull up CR2 register values from f0/f3
Just small pieces at a time to make it easy to see what's happening.
Taking definitions currently implemented in both f0/f3 headers and
making combined, documented versions in the -v2 header.
2017-10-25 22:57:18 +00:00
Karl Palsson 670a7cd83e stm32f0: use usart-v2 instead of private usart
Use the usart-common base plus the usart-v2 code, instead of private
implementations.  Less code, more common apis across targets.

Of note is the trick to make F0 look like it has an APB2 bus.  It's the
only stm32 that doesn't have a documented APB2 bus, but still has
peripherals enabled via an "APB2" register, and they match how other
targets have an APB2.  Simply make APB2 an alias of APB1, as it's only
used for clock speed detection.
2017-10-25 22:55:10 +00:00
Karl Palsson 9d709e52b4 stm32: usart: move USARTX definitions to target/version specific
Instead of declaring that _every_ device has USART1,2,3 and UART4,5, let
the targets themselves define what periphs they do, along with their
USARTx_BASE defines, and let the common headers just have the common
abstractions.
2017-10-25 22:55:09 +00:00