2611 Commits

Author SHA1 Message Date
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
Jakob Haufe
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
Fabio Pugliese Ornellas
f2f5083761 usb: Add more HID Class constants 2019-12-25 20:44:46 +00: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
f70f0d0b7b stm32g0: pwr: doc: remove duplicated ingroup 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
169d23568f stm32: lptimer: fix documentation 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
Karl Palsson
a5b6673b62 stm32: usart-v2: fix some doxygen linking problems 2019-12-25 20:30:03 +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
Karl Palsson
fa3c1df6f5 pac55xx: fix up and simplify some doxygen 2019-12-25 13:44:49 +00:00
Brian Viele
a3406f100b pac55xx: gpio: Initial Implementation of PAC55xx GPIO Driver
* Conforms mostly to the STM32 GPIO API where possible.
* Supports pin configuration (direction, pull-up/down, etc.) as well
  as pinmux configuration.
* Supports set/clear/get operations to the GPIO port/pins.
* Created base doxy header and groups to align with existing formatting.
2019-12-25 13:44:35 +00:00
Karl Palsson
9598b7f424 doc: stm32:rcc: flag "better" periph enable options
The original rcc_peripheral_enable_clock aren't explicitly deprecated,
as they do let you enable multiple periphs in one call.  But they're
error prone, from user feedback, so update the docs to ensure people
know what the other options are.
2019-12-12 20:37:58 +00:00
Karl Palsson
85275fd62e stm32f1: adc: doc: drop undocumented examples
There's already example code, this was just conflicting extra code that
wasn't being included in doxygen anyway.
2019-12-12 20:36:51 +00:00