1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

44670 Commits

Author SHA1 Message Date
Marian Buschsieweke
60676bfd5c
Merge pull request #20107 from maribu/cpu/nrf51/periph/i2c.c
cpu/nrf51: fix periph_i2c driver
2023-11-24 10:23:57 +00:00
Marian Buschsieweke
cd897ebb99
Merge pull request #20103 from chrysn-pull-requests/fix-rng-docs
sys/rng doc: Point to auto initialization
2023-11-24 09:09:32 +00:00
Marian Buschsieweke
e407460243
cpu/nrf51: fix periph_i2c driver
The `i2c_read_bytes()` and `i2c_write_bytes()` function return the
number of bytes written / read, instead of `0` as the API contract
says. This fixes the issue.
2023-11-24 10:03:07 +01:00
Marian Buschsieweke
f55af92735
boards/nrf51dk: add arduino features 2023-11-24 09:49:19 +01:00
Marian Buschsieweke
fa0b6824d2
boards/nrf51dk: add periph_adc 2023-11-24 09:49:11 +01:00
Marian Buschsieweke
6ae0b4d5ed
Merge pull request #20084 from maribu/stm32_spi
cpu/stm32/periph_spi: Fix /CS handling
2023-11-24 07:59:39 +00:00
Marian Buschsieweke
f4729c28ec
cpu/stm32/periph_spi: improve prescaler calculation
With only 8 possible prescalers, we can just loop over the values
and shift the clock. In addition to being much easier to read, using
shifts over divisions can be a lot faster on CPUs without hardware
division.

In addition an `assert()` is added that checks if the API contract
regarding the SPI frequency is honored. If the requested clock is too
low to be generated, we should rather have a blown assertion than
hard to trace communication errors.

Finally, the term prescaler is used instead of divider, as divider may
imply that the frequency is divided by the given value n, but
in fact is divided by 2^(n+1).
2023-11-24 08:49:25 +01:00
Marian Buschsieweke
63a2a50b5f
cpu/stm32/periph_spi: Fix /CS handling
Previously, the /CS signal was performed by enabling / disabling the
SPI peripheral. This had the disadvantage that clock polarity settings
where not applied starting with `spi_acquire()`, as assumed by e.g.
the SPI SD card driver, but only just before transmitting data.

Now the SPI peripheral is enabled on `spi_acquire()` and only disabled
when calling `spi_release()`, and the `SPI_CR2_SSOE` bit in the `CR2`
register is used for hardware /CS handling (as supposed to).
2023-11-24 08:49:25 +01:00
Marian Buschsieweke
7057aa674d
cpu/stm32: Provide spi_mode_t
This doesn't change the firmware, since for all STM32 MCUs with an
SPI driver the register setting in the mode did match the SPI mode
number by chance. But for some STM32 MCUs with no SPI driver yet
the register layout is indeed different. This will help to provide an
SPI driver for them as well.
2023-11-24 08:49:24 +01:00
chrysn
e9e1f9cce4 sys/random doc: Point to auto initialization and its caveats 2023-11-23 23:34:56 +01:00
Urs Gompper
bfb3b5fe72 dist/tools/doccheck: add FREQM config to generic_exclude_pattern 2023-11-23 21:00:16 +01:00
Urs Gompper
a2e4fa30fd boards/same54-xpro: overwrite GCLK definitions 2023-11-23 21:00:16 +01:00
Urs Gompper
12acc8dec9 cpu/samd5x: make GCLK definitions overwritable 2023-11-23 21:00:16 +01:00
Urs Gompper
f352609c5e cpu/sam0_common: added peripheral FREQM configuration declaration 2023-11-23 21:00:16 +01:00
Urs Gompper
6849ef9827 boards/same54-xpro: added FREQM peripheral configuration 2023-11-23 21:00:16 +01:00
Urs Gompper
b1e31fbf61 cpu/samd5x: define GCLK pins 2023-11-23 21:00:15 +01:00
Urs Gompper
97bde07e0d drivers/periph_common: add peripheral freqm to Kconfig 2023-11-23 20:53:15 +01:00
Urs Gompper
82f803b7cf boards/same54-xpro: add freqm peripheral to Kconfig 2023-11-23 20:53:15 +01:00
Urs Gompper
c2f7aa66f9 boards/same54-xpro: add periph_freqm to Makefile.features 2023-11-23 20:53:14 +01:00
Urs Gompper
5479c7eb96 cpu/samd5x: add conditional enabling of freqm peripheral 2023-11-23 20:53:14 +01:00
Urs Gompper
4a9ae47499 tests/periph: add test-application for peripheral freqm 2023-11-23 20:53:14 +01:00
Urs Gompper
afcd4801bd drivers/include: add header definition for freqm 2023-11-23 20:37:52 +01:00
Urs Gompper
4c97a27826 cpu/sam0_common: implement freqm peripheral 2023-11-23 20:37:51 +01:00
chrysn
df70e00b92 sys/random doc: Make implementation list visible 2023-11-23 16:50:23 +01:00
Marian Buschsieweke
8d8bd82437
Merge pull request #20101 from maribu/tests/periph/selftest_shield
tests/periph/selftest_shield: Improve error output
2023-11-22 13:03:08 +00:00
Marian Buschsieweke
fb9abe3626
tests/periph/selftest_shield: fix a misplaced comment
Move it to the correct place
2023-11-22 10:29:33 +01:00
Marian Buschsieweke
64b95a34e9
tests/periph/selftest_shield: improve output on error
Use `tiny_strerror()` to report back errors when calling initialization
functions.
2023-11-22 10:29:33 +01:00
Marian Buschsieweke
e7c9451b55
drivers/pcf857x: use errno code for error reporting
This makes it easier to use common error reporting such as `strerror()`
or `tiny_strerror()` to give more insight on why something failed.

The custom error codes via `enum` have been updated to be synonymous
with the `errno` codes for backward compatibility.

In addition, `pcf857x_init()` has been updated to no longer or
together the return code, but rather abort on the first fail transaction
and return the error code as is. Otherwise (when both fail due to
different error codes) the returned error code may be garbage.
2023-11-22 10:29:33 +01:00
Marian Buschsieweke
1cdd114e6c
Merge pull request #20097 from maribu/boards/nucleo-f303re
boards/nucleo-f303re: add more timers
2023-11-21 12:59:09 +00:00
Marian Buschsieweke
2853e9b59c
Merge pull request #20098 from krzysztof-cabaj/nucleo-l433rc-DOC
boards/nucleo-l433rc: doc update - image and MCU table
2023-11-21 09:06:43 +00:00
Marian Buschsieweke
3848a37d14
boards/nucleo-f303re: add more timers 2023-11-21 09:02:31 +01:00
Marian Buschsieweke
097b99f4f2
cpu/stm32: always apply /CS settings
The CR2 register was only written to if the settings differ from the
reset value. This wasn't actually a bug, since it was cleared in
`spi_release()` to the reset value again. Still, it looks like a bug,
may cause a pipeline flush due to the branch, and increased `.text`
size. So let's get rid of this.
2023-11-21 08:25:32 +01:00
Marian Buschsieweke
4232fea164
Merge pull request #20096 from maribu/tests/periph/selftest_shield
tests/periph/selftest_shield: timer allocation conflict
2023-11-21 05:03:31 +00:00
krzysztof-cabaj
04d08e4c2e boards/nucleo-l433rc: doc update - image and MCU table 2023-11-20 21:34:13 +01:00
Marian Buschsieweke
f9e4affd19
Merge pull request #19792 from kyleb29/bugfix-19787
cpu/stm32/periph_i2c: prevent corrupting AFIO->MAPR
2023-11-20 20:33:16 +00:00
Kyle Burk
986488db85
cpu/stm32/f1: prevent corrupting AFIO->MAPR
The `SWJ_CFG` field of the `AFIO_MAPR` register is write only and values
read are undefined (random). Hence, using `AFIO->MAPR |= mask;` to
enable flags can corrupt the state of the `SWJ_CFG` (configure it to
an unintended value).

Two helper functions have been introduced:
- `afio_mapr_read()` reads the value, but sanitizes the `SWJ_CFG` field
  to zero
- `afio_mapr_write()` writes the given value, but applies the `SWJ_CFG`
  configured by the board before writing.

Finally, the `nucleo-f103rb` and `bluepill*`/`blackpill*` boards have
been updated to no longer specify `STM32F1_DISABLE_JTAG`, as this
is handled by the `SWJ_CFG` setting (which defaults to disabling JTAG).
2023-11-20 20:28:52 +01:00
Marian Buschsieweke
57488a57ab
tests/periph/selftest_shield: timer allocation conflict
- Detect when the same timer is used by `ztimer` (pulled in as
  dependency for a peripheral driver, e.g. `periph_adc` on STM32F3) and
  the test application
- Try to provide a better default (e.g. `TIMER_DEV(1)` when
  `ztimer_periph_timer` is in use, `TIMER_DEV(0)` otherwise)
2023-11-20 17:17:26 +01:00
Kevin "Tristate Tom" Weiss
e51dc0937d
Merge pull request #20092 from MrKevinWeiss/pr/releasenotes202310
release-notes.txt: add 2023.10 release notes
2023-11-20 13:00:50 +00:00
MrKevinWeiss
24893fa06e
release-notes.txt: add 2023.10 release notes 2023-11-20 13:20:19 +01:00
Marian Buschsieweke
6380d81119
Merge pull request #20091 from benpicco/at24cs0x
drivers/at24cxxx: add defines for AT24CS04 & AT24CS08
2023-11-16 17:41:29 +00:00
Marian Buschsieweke
4e7f972303
Merge pull request #20089 from maribu/tests/periph/selftest_shield2
tests/periph/selftest_shield: improve SPI test
2023-11-16 14:39:38 +00:00
Benjamin Valentin
1a19005c22 drivers/at24cxxx: add defines for AT24CS04 & AT24CS08 2023-11-16 14:28:20 +01:00
Karl Fessel
8a9fdf4661
Merge pull request #20062 from derMihai/at_fix_pr
drivers/at: fix URC collision with command response
2023-11-16 12:04:48 +00:00
Marian Buschsieweke
14ff958659
Merge pull request #20083 from maribu/tests/periph/selftest_shield
tests/periph/selftest_shield: re-enable ADC test
2023-11-16 12:04:00 +00:00
Marian Buschsieweke
66d38101d8
tests/periph/selftest_shield: Consistently use DETAILED_OUTPUT
There already is `DETAILED_OUTPUT` to trade ROM size for more verbose
error messages, no need to abuse `DEBUG()` for the same as well.
2023-11-16 12:59:50 +01:00
Marian Buschsieweke
f51ca593ba
tests/periph/selftest_shield: re-enable ADC test
The R-2R resistor ladder dac --> ADC test was disabled due to a bug in
the v0.1 version of the shield. Since this has been fixed in v0.2 and
v0.3 of the shield, it can be re-enabled.

The comment regarding the high accuracy of the resistor is dropped, as
v0.3 has been ordered with cost efficient resistors rather than with
accurate ones. As a result, the tolerance for error has been increased
to 10%. This quite a bit more lax than I have hoped for, but false
positives would be something to avoid.
2023-11-16 12:59:50 +01:00
Dylan Laduranty
5701ebb6ff
Merge pull request #20090 from maribu/boards/p-nucleo-wb55
boards/p-nucleo-wb55: Add pinout and clean up doc
2023-11-16 10:52:37 +00:00
Marian Buschsieweke
61af0f38f8
boards/p-nucleo-wb55: Add pinout and clean up doc 2023-11-16 11:14:45 +01:00
Marian Buschsieweke
bf90638e80
Merge pull request #20087 from MrKevinWeiss/pr/fix/esp32s3-wt32-sc01-plus
cpu/esp32: Fix kconfig of esp-lcd
2023-11-16 07:11:27 +00:00
Marian Buschsieweke
af6bb03bc7
tests/periph/selftest_shield: improve SPI test
- fix a copy-paste error (`TIMER_FREQ_UART_TEST` was used in the SPI
  test, but that should be `TIMER_FREQ_SPI_TEST`)
- use 400 kHz as slow SPI frequency, as faster STM32 MCUs just cannot
  divide the APB clock down to 100 kHz
- when detailed output is enabled, print the SPI clock in addition to
  the SPI mode to ease figuring out what went wrong
- only have one `FAILURE` message for a too fast byte transfer per
  check, rather than per transmitted byte, to reduce the noise
- work around a bug of `periph_timer` on STM32 by reducing the clock
  speed of the timer for the SPI test
2023-11-15 20:29:53 +01:00