Commit Graph

308 Commits

Author SHA1 Message Date
dragonmux
c2ecd4545a stm32/f7: Created a meson build system for the STM32F7 series support 2025-07-12 10:32:11 -07:00
dragonmux
6a61af6c75 stm32/f4: Created a meson build system for the STM32F4 series support 2025-07-12 10:32:11 -07:00
dragonmux
80cf453429 stm32/f3: Created a meson build system for the STM32F3 series support 2025-07-12 10:32:11 -07:00
dragonmux
4403f2a130 stm32/f0: Created a meson build system for the STM32F0 series support 2025-07-12 10:32:11 -07:00
dragonmux
3e34a52db5 stm32/common: Created a Meson build system for common part of STM32 targets 2025-07-12 10:32:11 -07:00
ALTracer
cb1fe86008 stm32: usart_common_all: Implement usart_get_baudrate
* Handle OVER8 when set, as 2x clock
* Handle LPUART specially, as 256x clock, without overflowing uint32_t
2025-07-12 13:39:32 +01:00
fenugrec
a7632df7f4 iwdg: START and UNLOCK values before polling Busy
With code that uses IWDG and these operations:

- user code initializes iwdg
- user code jumps to USB-DFU
- USB host triggers a USB exit (e.g. after reflashing, or even just a
  dummy dfu-util Reset/Exit command)
- user code will hang in iwdg_prescaler_busy() called from
  iwdg_set_period_ms()
2025-07-11 21:05:58 -07:00
Mateusz Myalski
3f5e250f42 Added iwdg support + early wakeup 2025-07-11 20:31:43 -07:00
dragonmux
94411df91f stm32/common: Implemented oversampling control support for the F2/F4 parts 2025-07-11 20:26:35 -07:00
dragonmux
2d15b12ff2 stm32/common: Implement handling for setting the baud rate correctly when in 8x oversampling mode 2025-07-11 20:26:35 -07:00
dragonmux
9480f493b9 stm32/common: Implement support for DE and changing the oversampling mode 2025-07-11 20:26:35 -07:00
dragonmux
cdd8f2adac stm32/h7: Implemented support for the Flash controller having untangled the previous pretending it was the F2/F4 controller mess 2025-07-11 20:26:35 -07:00
dragonmux
83e571db67 stm32/h7: Fixed the QuadSPI headers not working with multiple peripehrals 2025-07-11 20:26:35 -07:00
dragonmux
a50a15e660 stm32/common: Removed the unnecessary and standards-forbidden (void *) casts from the callback registrations 2025-07-11 19:18:13 -07:00
dragonmux
345b20fb9f stm32/timer: Moved the OC4 mode logic into its own function 2025-07-11 19:15:56 -07:00
dragonmux
1254cb8cc8 stm32/timer: Moved the OC3 mode logic into its own function 2025-07-11 19:15:56 -07:00
dragonmux
a058f77434 stm32/timer: Moved the OC2 mode logic into its own function 2025-07-11 19:15:56 -07:00
dragonmux
f2a1f2b6ae stm32/timer: Moved the OC1 mode logic into its own function 2025-07-11 19:15:56 -07:00
dragonmux
60ff345798 usb: Begun implementing support into the USB device machinary for BOS descriptors 2025-07-11 19:14:29 -07:00
dragonmux
56ec4c2b06 stm32/usart: Automatic whitespace cleanup 2023-04-16 22:18:43 -07:00
dragonmux
188671389d stm32/usart: Implemented a function to get the current parity setting for a USART 2023-04-16 22:18:43 -07:00
dragonmux
48a8355874 stm32/usart: Implemented a function to get the current stop bits setting for a USART 2023-04-16 22:18:43 -07:00
dragonmux
0241982fb4 stm32/usart: Implemented a function to get the current databits setting for a USART 2023-04-16 22:18:43 -07:00
Rohit Nimkar
f3049c6699 doc: stm32: rcc: improve intellisense
Removed newline between the comment block and function definition
It enables vscode intellisense to display documentation about functions

Reviewed-by: Karl Palsson <karlp@tweak.au>
2023-02-03 00:15:12 +00:00
Harry Geyer
4d7a2ca271 stm32: When setting baudrate of a USART, first get the clock frequency for that USART.
Now that all families have support for calculating the clock of the
uart, use that layer.  Slightly slower for "old" families, but the only
way to be correct for newer families.

Reviewed-by: Karl Palsson <karlp@tweak.au>
2023-02-03 00:02:59 +00:00
Karl Palsson
df654d7f28 stm32: spi: drop spi_reset()
It's simply a wrapper around rcc_reset_pulse already.
Just drop it. See 034dbf20ff for the same deletion for timers.

Signed-off-by: Karl Palsson <karlp@tweak.au>
2023-01-13 02:15:41 +00:00
Karl Palsson
b3bdf025d7 stm32: i2c: drop i2c_reset()
It's simply a wrapper around rcc_reset_pulse already.
Just drop it. See 034dbf20ff for the same deletion for timers.

Signed-off-by: Karl Palsson <karlp@tweak.au>
2023-01-13 02:15:41 +00:00
Karl Palsson
5db7e87e6e doxygen: stm32:cordic: add a title 2022-10-27 21:37:00 +00:00
Oskar
d8d33ca36d stm32: cordic: add new peripheral
Review-URL: https://github.com/libopencm3/libopencm3/pull/1418
Reviewed-by: Karl Palsson <karlp@tweak.net.au>

Edits: removed non-existant u5 code, squished to a single commit,
whitespace cleanup.
2022-10-27 21:37:00 +00:00
hepoun
c82c7406aa stm32:dmamux: Fix request generator reset
There was reset of DMAMUX request multiplexer channel instead of the DMAMUX request generator channel.
2022-09-08 11:42:52 +00:00
me@me.net
d8aa2f17b0 stm32: timer: Add API to set external clock mode 2 2022-04-27 13:11:58 +00:00
Stefan Tauner
a6927e410c treewide: Fix some typos 2022-04-13 20:22:24 +00:00
Karl Palsson
3f52b7784c stm32/timers: clarify "advanced timers" restriction
by making it vaguer.  These days, there's extra timers that support the
BDTR register, so the simple "advanced" timer description is no longer
sufficiently clear.  You have to check your particular reference manual.

Fixes: https://github.com/libopencm3/libopencm3/issues/1378
2022-02-01 13:15:13 +00:00
mikisama
25b1e4aad9 stm32: fix typo 2021-12-07 09:41:16 +08:00
Bastian de Byl
6763681c26 STM32: Fixed ltdc_setup_windowing helper 2021-08-14 21:44:10 +00:00
Karl Palsson
470a1394a8 doc: stm32: timer: switch f1/other example
Reported in: https://github.com/libopencm3/libopencm3/issues/1353
Fixes: d8d63b3184  (wrongly assumed existing example was for f1)

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2021-07-31 21:45:53 +00:00
weycen76
12da5bbd9e stm32:iwdg: reset counter after changing period.
Fix the bug that the iwdg counter is not refreshed after the configurationis complete, if this counter is not refreshed after the configuration is completed, the first iwdg counting period will be as long as 26 seconds.

Fixes: https://github.com/libopencm3/libopencm3/pull/1333
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2021-07-01 22:15:23 +00:00
Eduard Drusa
9478931d69 Fix FDCAN incorrect FIFO acknowledgment
Fix incorrect way of acknowledging FIFO processing. Old code ORed old
value of register with index of FIFO buffer just processed, which
generated invalid value for acknowledge. This caused FIFO to repeatedly
returning same content. Both fdcan_receive() and fdcan_release_fifo were
affected.
2021-07-01 21:48:12 +00:00
Karl Palsson
504dc95d9b stm32:fdcan: fix doxygen warnings
Added some descriptions for missing parameters, (hopefully) clarified
some along the way.  Fixed all can related warnings in doxygen logs.
Added doxgen tags where meaningful comments had been provided.  Dropped
redundant comment separators.
2021-04-16 12:38:31 +00:00
Eduard Drusa
32354846bd STM32H7: Implement basic FDCAN support
Add stm32h7 support for FDCAN peripheral. Source level compatibility is
provided with stm32g4. Additional features of stm32h7 such as
configurable buffers are supported. Implementation offers feature parity
with stm32g4 implementation.
2021-04-16 11:47:02 +00:00
Bastian de Byl
0d72e6739c stm32 added better RTC periph API functions
Originally tracked at https://github.com/libopencm3/libopencm3/pull/1319
2021-03-25 21:11:07 +00:00
Eduard Drusa
458250dc61 STM32G4: Add support for FDCAN
Add stm32g4 support for FDCAN peripheral. Normal / FDCAN operation
supported, bitrate switching and filtering supported via API.
Timestamping and transmit event buffer support in API are TBD.

Originally tracked as: https://github.com/libopencm3/libopencm3/pull/1317
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2021-03-16 20:46:15 +00:00
Jean THOMAS
a9cc695381 stm32: i2c: Use const qualifier for read-only pointer in i2c_transfer7 2021-02-26 13:07:20 +00:00
Karl Palsson
ca479ad7d2 stm32: quadspi overhaul documentation
Provide all doxygen framework boilerplate.
Provide a very initial stub .c file to ensure that heirarchical headers
are pulled in properly.
2021-01-29 13:00:53 +00:00
Karl Palsson
5f4e2b3758 stm32:i2c-v1: eliminate doxygen warnings
We deprecated the defines in favour of just using the value itself, so
there's no longer a defined group to reference.
2021-01-28 00:33:07 +00:00
Karl Palsson
0f1f1ebd1a stm32:dac: Fix waveform generation apis
These were broken earlier, with no sane way of passing in correctly shifted
values, and didn't match examples.

Noticed while merging: https://github.com/libopencm3/libopencm3/pull/1281
2021-01-27 23:50:22 +00:00
Karl Palsson
8295d248e0 stm32:dac: new api for waveform characteristics
Old API required users to manually construct bit maps frm opaquely named
defines, with little help.  It also was a pure OR operation, with no way
to ever clear bits.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2021-01-27 23:50:15 +00:00
Stijn Martens
f9d5fb738e stm32: usart: add idle interrupt enable/disable 2021-01-26 10:43:23 +01:00
Karl Palsson
34a44af4e4 stm32: dac: fix doxygen parameter link 2021-01-24 22:34:10 +00:00
Karl Palsson
59fdb61bf2 stm32: dac: doc: link data types
And also drop pointless whitespace and divider markers
2021-01-24 22:23:25 +00:00