Commit Graph

2627 Commits

Author SHA1 Message Date
Karl Palsson 4e70d06d63 stm32g4: Add basic support
* memorymap
* vectors
* rcc
* gpios
* makefiles
* devices for linker script generation
* doc structure
2020-04-09 23:29:00 +00:00
Karl Palsson 57373b3413 stm32l4: rcc: fix bit error in BDCR
And add the new bit from later ref manuals
2020-04-09 22:04:49 +00:00
Kevin Stefanik 89e90e0e5d pac55xx: gpio: fix gpio_set_af for pin alternate function settings.
register bits were not cleared before setting. refactored to be similar
to how the drive strength register is being set.
2020-04-09 14:17:27 +00:00
Guillaume Revaillot abc74fd78b stm32g0: fix typos in rcc.h 2020-04-08 07:50:14 +02:00
Florian Larysch f4ec5b9f9b stm32g0: fix RCC enums for UCPD peripherals
The order of the UCPD1 and UCPD2 bits as described by the
rcc_periph_clken and rcc_periph_rst enums is swapped with regard to the
datasheet. Swap them.
2020-04-07 21:37:22 +02:00
Brian Viele b1d8a4c546 stm32h7: added minimal stm32h7 exti defs, which share with G0.
Separated definitions that did not seem consistent between the "v2" EXTI
platforms. Added SYSCFG defs needed for EXTICR settings.
2020-03-23 09:23:21 -04:00
Brian Viele 89074d6a13 stm32h7: fix inverted VOS settings for Vcore. 2020-03-10 10:16:26 +00:00
Karl Palsson 4a11e354a3 stm32l1: desig: use new mechanism to support different densities
Fixes: https://github.com/libopencm3/libopencm3/issues/234

uses the new mechanisms introduced to address a similar problem on F7.

Tested on a medium density part (0x429) that returns the same ids as
before, tested on a high density part that now _doesnt_, but that's now
correct :)
2020-03-06 22:53:03 +00:00
Karl Palsson 78c23ba5a0 doc: stm32f4: fix broken groupings
Now all the register value sets are in the generated output
2020-03-06 01:14:44 +00:00
Karl Palsson b146fd6aa7 doc: stm32: flash: tidy up doxygen warnings and broken groupings 2020-03-06 01:14:17 +00:00
Karl Palsson 3df3ed7db9 doc: stm32f0/f3: adc: fix doxygen warnings 2020-03-06 01:13:22 +00:00
Karl Palsson dca79bfd7a doc: stm32l1: lcd: fix groupings and convert to doxygen 2020-03-06 01:11:45 +00:00
Karl Palsson 341bd84cb9 doc: stm32h7: cleanup warnings and groupings
Move shifts and masks outside groups to clarify docs from a user point
of view. fix missing or broken groupings
2020-03-06 01:10:20 +00:00
Brian Viele 4953d67aaa stm32h7: per comments, improved consistency with other rcc impls.
Reduced the sea of enums, and renamed config parameters to match other
implementations, cribbing off of the G0 config, as it is closer to the level
of complexity. Updated initialization code to utilize the new values.

Added flash and LDO configuration from RCC init to be more consistent with
STM32 platform initialization.
2020-03-05 22:07:10 +00:00
Karl Palsson 5f8cbb95e6 stm32: ltdc: clarify warning on faulty include
No code change.
2020-03-05 21:59:29 +00:00
François Finfe fb0cac49cb stm32: adc-v2: add adc_{en,dis}able_delayed_conversion_mode
To control AUTODELAY feature of the ADC.
2020-03-04 23:29:31 +00:00
Karl Palsson f1073e7991 stm32h7: stop attempting to use common usart code.
Until h7 implements a method of providing the periph clocks in a
compatible manner, they simply can't use the common_all files.
2020-03-04 23:24:02 +00:00
Brian Viele 2ca56f4c21 stm32h7: updates to PWR and RCC to support PLL configuration.
PLL configuration on the H7 is pretty involved, and takes a number of
configurations to make it work. In order to make peripheral drivers a bit
easier to implement, working with a soft clock tree in the rcc module which
stores the clock settings for each clock as they are setup such that users
can request the clock value from the RCC module for configuration. Added
getter for the clock which allows the user to pass the base address of the
peripheral, and get the peripheral clock value for convenience.

Clock configuration is still missing values for setting up all of the kernel
clocks for the peripherals, but this is in work, and there is a framework to
do so.

Have tested to 400MHz without issue. Peripherals that are explicitly supported
are working and the clock tree values appear to follow correctly.

Added LDO settings to allow setting the scaling to support high frequencies.
2020-03-04 23:17:02 +00:00
Matthew Lai 97688b913e stm32: desig: refactor to allow targets to have different addresses
In this commit, support for the different base addresses for different
F7 parts is added, but the mechanism is now in place for L1 and others.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
(whitespace fixed, commit msg reworded)
2020-03-04 22:16:31 +00:00
Karl Palsson f1b4a4dfff stm32f3: adc: consistently use unshifted
and tweak teh docs a little
2020-03-04 22:02:45 +00:00
François Finfe 49285ed8e1 stm32f3: fix missing reg mask for adc_set_multi_mode
Missing defines for ADC_CCR DUAL values have also been added.
2020-02-19 00:13:00 +01:00
Brian Viele cb0661f81d stm32h7: fmc: added bit defs for async configuration. 2020-02-16 13:52:04 +00:00
dima 72274d3caf Remove SRCLIBDIR definition from the top Makefile
All submakefiles have sensible defaults (either .. or ../..), so there is no need to fiddle with whitespaces in the dir name.
2020-02-02 10:55:01 +00:00
sur5r d0d23cff07 ld: lpc17xx: Fix RAM2_OFF on LPC17[78]x
- RAM2_OFF is at 0x20004000 (see UM10470 page 15)
- 0x20040000 is not a valid address on LPC17[78]x
2020-01-31 20:52:12 +00:00
Caleb Szalacinski 4b3d583394 swm050: register fix for timer_clock_div 2020-01-28 23:53:55 -06:00
Karl Palsson 8a915a8a18 doc: sam: fix duplicate and missing parameter docs 2020-01-28 23:04:30 +00:00
Karl Palsson 4f2d6c2988 doc: enable samd and sam4l family documentation
Was lost in some re-org, turn it back on.
2020-01-28 23:04:00 +00:00
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
Karl Palsson 6f25d51be6 cm3: nvic: use separate documentation to avoid warnings on cm0
Squelches some doxygen warnings, and makes the generated docs "right"
for each arch
2020-01-28 22:31:38 +00:00
Karl Palsson 26d6f8f77e swm050: timer: use more standard bit definitions
We normally use periph_reg_field naming, and most of this file was
already consistent. Switch the stragglers.
2020-01-28 22:31:38 +00:00
Karl Palsson a6aecf8ccd swm050: simplify doxygen
We don't need groupings around each enum, they format nicely into a
section already.  Likewise, the doxygen _is_ documentation, so we don't
need extra versions of it in places. Also fix a few warnings generated.
2020-01-28 22:31:24 +00:00
Caleb Szalacinski f06a1ca958 SWM050: Adds the timer peripheral and updates the README. 2020-01-28 20:58:50 +00:00
Fabio Pugliese Ornellas 7daa6f15bf usb: define USB_CLASS_DFU 2020-01-12 20:31:26 +00:00
Guillaume Revaillot a8a92b4c11 rng: fix clock error handling, based on RM.
According to L4/L0/G0 RM, in case of clock error, interrupt flag must
be cleared, and CECS flag should be cleared as soon as clock meets
requirement.

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

Reviewed-on: https://github.com/libopencm3/libopencm3/pull/1062
2020-01-05 00:25:00 +00:00
Guillaume Revaillot 5a53f18a78 rng: check error before checking if data ready.
mostly cosmetic, but ease debugging.
2020-01-05 00:24:43 +00:00
Guillaume Revaillot 64baacfbbf rng: add irq enable/disable helper. 2020-01-05 00:24:43 +00:00
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 a759a0d9c9 stm32f3: unify implementation with f0 adc_enable_analog_watchdog_on_selected_channel
- match the same logic as the f0 api
- use ADC_CFGR1_AWD1CH_VAL macro to mask the channel bits
- don't check if channel is < 18q
- enable the awd in addition to setting the selection to single channel monitoring (in following with the signature and @brief 'enable'
2020-01-05 00:10:01 +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
balanceTWK 6fc1ff225e stm32:L4:flash: support erasing pages on bank 2
Reviewed-by: Karl Palsson <karlp@tweak.net.au> (fixed code style)
2020-01-05 00:03:06 +00:00
Brian Cooke d44ffe8c0b tests/gadget0: avoid floating point division
Reviewed-by: Karl Palsson <karlp@tweak.net.au> (Changed from cast to
literal int, more inline with efm32 and clearer intent)
2020-01-04 23:49:16 +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
Karl Palsson 911d4be35b gitignore: ensure some non-generated are included
A normal git clone doesn't catch these, as it _knows_ that the files are
in the git repo and should be tracked.  However, downloading a tarball,
and adding it to a new git repo shows up the problem as important files
are simply not added, and would be dropped by git clean.

Reported-by: https://github.com/libopencm3/libopencm3/issues/1153
2020-01-04 23:01:57 +00:00
Guillaume Revaillot 9d15ac7ae7 cortex: FAULTMASK does not exist on armv6m. 2020-01-04 21:53:34 +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
Sam Protsenko f7a952c41a stm32: Fix typo in RCC related comments
ABP -> APB

Signed-off-by: Sam Protsenko <joe.skb7@gmail.com>
2019-12-26 13:46:30 +00:00
Karl Palsson df15b263d2 usb: hid: add a stub file for doxygen
Unlike with the doxygen source generation, we can't autoguess which of
the class files are eligible automatically.  Instead, make a stub hid
file, (which we can now start adding to, if desired) and include it in
all builds that include other class stubs.
2019-12-25 21:04:17 +00:00