Commit Graph

289 Commits

Author SHA1 Message Date
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
Karl Palsson
3eb94bb335 stm32: dac: document: whitespace for legibility 2021-01-24 22:10:05 +00:00
Ben Brewer
1ebf172bcb stm32/dac: Update API to support multiple DACs and add v2 support 2021-01-07 15:30:51 +00:00
Karl Palsson
97d5e9a403 doxygen: fix more broken groupings 2020-12-10 22:25:51 +00:00
Karl Palsson
e07f23bb70 doxygen: fix many warnings on "end of file while in group" 2020-12-10 21:51:48 +00:00
Ben Brewer
e923a6fe6a stm32g4: Add support for OPAMP
Move implementations into common and split into v1 and v2.
2020-12-10 16:46:24 +00:00
Karl Palsson
8435287300 stm32: dma: doxygen fixups
Use a single @defgroup for the "root" of a common heirarchy, and only
addtogroup for additions.  This prevents an alphabetically "first" entry
from being used as the documentation for the entire group.
2020-12-02 00:04:44 +00:00
Karl Palsson
f82053000c stm32: crs: fix doxygen
We need per device header includes to make the per target documentation
generation work properly.  The dispatch headers are to dispatch to the
_target_ not directly to the final implementation, remember, the final
required headers for each may be multiple files, plus extra definitions!
2020-12-01 23:13:38 +00:00
Brian Viele
e41ac6ea71 stm32: added peripheral clock get helpers for all stm32 platforms.
Allows for abstraction for code that's dependent on knowing the source clock
for a peripheral. Implemented a few core peripherals that tend to have clock
tree differences between platforms (USART, timers, I2C, SPI).
2020-11-28 22:13:25 +00:00
Karl Palsson
daf99b9b76 stm32: dcmi: hook up doxygen again
We still need stub .c files as we're using shared common files, so .d
tracking doesn't work.  It lets us setup basic introductory text anyway,
and there will be .c files eventually, so acceptable.
2020-11-28 22:13:25 +00:00
Themroc
d8d63b3184 stm32: timer common all: Fix documentation
Provide gpio examples for both f1 and "everyone else" gpio blocks

Originally filed at: https://github.com/libopencm3/libopencm3/pull/1243

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
 (Merged old and new into two new examples)
2020-11-28 22:13:25 +00:00
tute-avalos
b47d769369 stm32: uart: Add Trasmission Complete enable/disable interrupt functions 2020-11-28 22:13:25 +00:00
Karl Palsson
43b3fa5ddc stm32l0/l1: flash: support half page flashing
Tested on L1 and L0 using the "dapboot" project, see
https://github.com/devanlai/dapboot/pull/27 for L1
and
https://github.com/devanlai/dapboot/pull/30 for L0
2020-11-28 22:13:25 +00:00
Dima Barsky
08c5f2a1fb stm32: i2c-v1: Fixed a typo in i2c_read7_v1 and i2c_write7_v1
Replaced & with &&
Wait for all three bits to be set - SB, MSL, and BUSY.

Old code worked by chance, use booleans to correctly convey intent.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-10-16 12:00:20 +00:00
rma-x
24bef9c49e stm32:adc: Change bitwise AND to logical AND
The original bitwise AND was _functionally_ correct because all operands
were booleans, but it was very poor at conveying the intent.

Fixes #1230
2020-07-03 12:27:44 +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
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
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
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