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

4425 Commits

Author SHA1 Message Date
Benjamin Valentin
fcd734e10e drivers/ethos: add STDIO_UART_RX_BUFSIZE compat define 2024-02-03 13:09:10 +01:00
Marian Buschsieweke
47280b3a9b
drivers/w5100: make use of spi_transfer_u16_be()
This also fixes a bug, as the free coded byte swap code was incorrect.
2024-02-02 13:05:02 +01:00
Marian Buschsieweke
87abafb13f
drivers/periph_spi: Add spi_transfer_u16_be()
This adds a helper function to exchange a 16 bit number that is to
be transferred in big endian order on the wire.
2024-02-02 13:05:02 +01:00
Martine Lenders
34fcffe37b
Merge pull request #20170 from miquel-b/lsm6dsxx
drivers/lsm6dsxx: refactoring Lsm6dsl into common driver Lsm6dsxx
2024-01-30 19:07:04 +00:00
chrysn
55cbb7bdfa
Merge pull request #20303 from chrysn-pull-requests/rust-updates
treewide: Rust updates
2024-01-29 19:54:32 +00:00
chrysn
3c5a540d01 drivers/lsm303agr: Use version 1.0 of driver 2024-01-27 09:41:26 +01:00
chrysn
96af920a12 drivers/lsm303agr: Use version 0.3 of driver
Note that for the very CPU this driver is used with (nRF52 on the
microbit-v2 board), this currently needs extra workarounds to copy
written data from flash to RAM so that the driver can see it. (Otherwise
it silently writes 00, and then correctly reads 00 from the bus all the
time).
2024-01-27 09:41:26 +01:00
Benjamin Valentin
a774ad935b drivers/w5100: make use of netdev_eui48_get() 2024-01-26 21:42:27 +01:00
MrKevinWeiss
bd64ed460b
drivers/lsm6dsxx: Cleanup style 2024-01-25 09:16:10 +01:00
MrKevinWeiss
ab84f2387b
drivers/saul: replace lsm6dsl->lsm6dsxx 2024-01-24 20:32:03 +01:00
MrKevinWeiss
1d05932bb9
drivers: Fix kconfig error
Even though it is removed just to get this through
2024-01-24 12:23:01 +01:00
Miquel-HAW
71169638ca drivers/lsm6dsxx: Implement common code 2024-01-24 09:57:04 +01:00
Marian Buschsieweke
bd3f54ac8f
drivers/periph_gpio_ll: Add features for compile-time-checks
This adds the features

 - periph_gpio_ll_input_pull_down:
        To indicate support for input mode with internal pull down
 - periph_gpio_ll_input_pull_keep:
        To indicate support for input mode with internal resistor
        pulling towards current level
 - periph_gpio_ll_input_pull_up:
        To indicate support for input mode with internal pull up
 - periph_gpio_ll_disconnect:
        To indicate a GPIO can be disconnected
 - periph_gpio_ll_open_drain:
        To indicate support for open drain mode
 - periph_gpio_ll_open_drain_pull_up:
        To indicate support for open drain mode with internal pull up
 - periph_gpio_ll_open_source:
        To indicate support for open source mode
 - periph_gpio_ll_open_source_pull_down:
        To indicate support for open source mode with internal pull down
2024-01-23 15:03:34 +01:00
Marian Buschsieweke
00cb9668ae
drivers/periph_gpio_ll: Improve documentation
The documentation on the state `GPIO_DISCONNECT` was a bit vague. The
API doc said it should disconnect the GPIO from all peripherals, the
test also tested them for being electrically disconnected.

The documentation in both the test and the API is extended to point out
that a GPIO indeed SHOULD be in high impedance state, but that user
MUST NOT expect that this requested is honored by every implementation
and for every GPIO pin.

In the test it is also pointed out that failing the test for a GPIO
in the `GPIO_DISCONNECT` state being electrically disconnected is for
some pins expected, and that the test should be just run again with
different GPIOs. The test intentionally tests for a feature not provided
by every GPIO pin rather than warning on a failure: The effort to just
flash and run the test again with different GPIOs is relatively low, but
it does confirm correct behavior of the API.
2024-01-22 10:28:35 +01:00
Marian Buschsieweke
922276296e
drivers/periph/gpio_ll: pass gpio_conf_t by value
Now that `gpio_conf_t` is on all implemented platforms no larger than
a register, we can more efficiently pass it by value rather than via
pointer.
2024-01-21 09:19:08 +01:00
Marian Buschsieweke
2a00ec13e5
drivers/periph/gpio_ll: shrink gpio_conf_t
This commit optimizes the `gpio_conf_t` type in the following
regards:

- The "base" `gpio_conf_t` is stripped from members that only some
  platforms support, e.g. drive strength, slew rate, and disabling of
  the Schmitt Trigger are no longer universally available but
  platform-specific extensions
- The `gpio_conf_t` is now crammed into a bit-field that is 8 bit or
  16 bit wide. This allows for storing lots of them e.g. in
  `driver_foo_params_t` or `uart_conf_t` etc.
- A `union` of the `struct` with bit-field members and a `bits` is used
  to allow accessing all bits in a simple C statement and to ensure
  alignment for efficient handling of the type

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2024-01-21 08:38:40 +01:00
Miquel-HAW
c79631c6a5 drivers/lsm6dsxx: Replace all lsm6dsl with lsm6dsxx in the files 2024-01-18 14:20:56 +01:00
Miquel-HAW
ce987ccddd drivers/lsm6dsxx: dir and file renaming 2024-01-18 14:20:56 +01:00
benpicco
d5f1fda70d
Merge pull request #20230 from benpicco/CONFIG_UART_DMA_THRESHOLD_BYTES
cpu/stm32: uart: don't do DMA for small transfers
2024-01-18 12:26:30 +00:00
Marian Buschsieweke
0cffb7f365
Merge pull request #20257 from fzi-haxel/native64-part1
core, sys, drivers: 64-bit support preparations
2024-01-17 15:40:34 +00:00
Frederik Haxel
3feb1a369b drivers: 64 bit compatibility
Fixed compilation errors for pointer casting.
2024-01-17 16:05:12 +01:00
Benjamin Valentin
1e1244042e drivers/mtd_spi_nor: make use of busy_wait() 2024-01-15 14:56:35 +01:00
Frederik Haxel
381cae6eb1 drivers: Added PRIuSIZE print format specifier 2024-01-12 17:17:33 +01:00
Gunar Schorcht
caa31ecbdc drivers/mtd: fix mtd_write_sector
Parameter `num` of `mtd_write_page_raw` is the number of bytes to be written, which is the number of sectors to be written`count` multiplied by the pages per sector `mtd->pages_per_sector` and the page size `mtd->page_size`.
2024-01-07 16:47:11 +01:00
Kevin "Tristate Tom" Weiss
7fef2e4b6f
Merge pull request #20214 from benpicco/CONFIG_SPI_DMA_THRESHOLD_BYTES
cpu/stm32/periph_spi: only perform DMA transfer above threshold
2024-01-04 17:32:02 +00:00
Benjamin Valentin
9710d4a23c drivers/periph: introduce CONFIG_UART_DMA_THRESHOLD_BYTES 2024-01-04 17:33:51 +01:00
benpicco
9b3c39ac76
Merge pull request #18066 from benpicco/slipdev-chunked_rb
drivers/slipdev: make use of chunked ringbuffer
2024-01-04 08:44:43 +00:00
Marian Buschsieweke
f860d96a25
Merge pull request #19891 from chrysn-pull-requests/ws2181x_timer
drivers/ws281x: Add gpio_ll and timer based driver
2024-01-03 09:22:26 +00:00
Benjamin Valentin
1a888fe556 drivers/slipdev: make use of chunked ringbuffer 2024-01-02 14:41:11 +01:00
benpicco
ece8a12f81
Merge pull request #20173 from fabian18/pr/mtd_flashpage_improve_write_page
drivers/mtd_flashpage: improve _write_page
2024-01-02 13:21:51 +00:00
Fabian Hüßler
37c39d0ee0 drivers/mtd_flashpage: improve _write_page 2023-12-31 00:26:40 +01:00
Benjamin Valentin
fbeb1f9a26 drivers/periph/spi: move DMA threshold to common code 2023-12-23 17:35:29 +01:00
Frederik Haxel
ec7fe8d598 drivers: Use size_t print format specifier
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-12-21 12:02:28 +01:00
MrKevinWeiss
7b80348f31
drivers/ws281x: Fix Kconfig
Patch from https://github.com/RIOT-OS/RIOT/pull/19891#pullrequestreview-1753651538
2023-12-19 11:13:43 +01:00
chrysn
d86405cef4
drivers/ws281x: Add timer and gpio_ll based driver 2023-12-19 11:13:43 +01:00
chrysn
02285fd63a
drivers/periph: Add timer_poll feature and timer_poll_channel function 2023-12-19 11:13:41 +01:00
benpicco
208790a5f1
Merge pull request #20108 from benpicco/drivers/dose-uart_ondemand_tx
drivers/periph/uart: add periph_uart_tx_ondemand feature
2023-12-14 20:42:55 +00:00
Benjamin Valentin
9cde80ef36 drivers_dose: enable TX UART on-demand 2023-12-14 18:30:38 +01:00
Benjamin Valentin
fc9669bcfd drivers/periph/uart: add periph_uart_tx_ondemand feature 2023-12-14 18:30:38 +01:00
Gunar Schorcht
aabc331494 drivers/mtd: improve doc consistency for MTDs 2023-12-14 17:27:13 +01:00
Gunar Schorcht
c872f0e18e drivers/sdcard_spi: small changes in doc for consistency 2023-12-14 17:26:29 +01:00
benpicco
d13e6c4e83
Merge pull request #20180 from benpicco/mtd_sdmmc-erase
drivers/mtd_sdmmc: always enable the erase function
2023-12-14 13:42:33 +00:00
Benjamin Valentin
bfe26c68d3 drivers/mtd: introduce mtd_write_sector() 2023-12-14 14:27:19 +01:00
Benjamin Valentin
f57f2a125f drivers/mtd_sdmmc: set MTD_DRIVER_FLAG_DIRECT_WRITE flag 2023-12-14 14:27:08 +01:00
Benjamin Valentin
f34abe88a0 drivers/mtd_sdmmc: always enable the erase function 2023-12-14 14:27:08 +01:00
benpicco
6eac1e1761
Merge pull request #15380 from benpicco/mtd_drop_write
mtd/*: drop .write() if .write_page() is implemented
2023-12-13 20:35:53 +00:00
Benjamin Valentin
9855b02b07 mtd: drop .write() function
All MTD drivers should now implement the .write_page() function instead.
2023-12-13 17:46:43 +01:00
Benjamin Valentin
431afeaa51 drivers/mtd_sdmmc: drop .write() function 2023-12-13 16:58:31 +01:00
Benjamin Valentin
cf123f98d5 drivers/mtd_emulated: drop .write() function 2023-12-13 16:56:51 +01:00
Benjamin Valentin
6c28a7d62c drivers/mtd_mapper: drop .write() function 2023-12-13 16:56:51 +01:00
Benjamin Valentin
ba17c14aef drivers/mtd_sdcard: drop .write()
The old .write() function is only used as a fall-back if .write_page()
is not implemented.
We can drop it.
2023-12-13 16:50:41 +01:00
Benjamin Valentin
ea105d34ec drivers/mtd_spi_nor: drop .write()
The old .write() function is only used as a fall-back if .write_page()
is not implemented.
We can drop it.
2023-12-13 16:50:41 +01:00
Benjamin Valentin
26aba7b8c7 drivers/at25xxx: drop .write()
The old .write() function is only used as a fall-back if .write_page()
is not implemented.
We can drop it.
2023-12-13 16:50:41 +01:00
Benjamin Valentin
5acfb20d02 drivers/periph/uart: add functions to query RTS/CTS pins 2023-12-12 20:25:39 +01:00
Gunar Schorcht
9410ec705e drivers/mtd: replace checks by assert in mtd_dev_get
Assertions are used instead of returning a NULL pointer to detect errors in the MTD definition and access in the case that the return value is not evaluated.
2023-12-07 15:32:49 +01:00
Gunar Schorcht
4b6e13ce29 drivers/mtd_default: remove extern mtd_dev_t * declarations 2023-12-07 15:32:49 +01:00
Marian Buschsieweke
b917807444
drivers/periph_timer: add periph_timer_query_freqs
Allow accessing supported timer frequencies with a dedicated API.
This API needs to be implemented per platform and is available with
the feature periph_timer_query_freqs.
2023-12-05 16:07:24 +01:00
Benjamin Valentin
97ab5ef12e drivers/sdmmc: fix placement of #endif 2023-12-05 08:55:08 +01:00
benpicco
ad7bf85712
Merge pull request #20113 from gschorcht/drivers/mtd/fix_xfa
drivers/mtd: fix the order of entries in the MTD pointer XFA `mtd_dev_xfa`
2023-11-27 19:00:04 +00:00
benpicco
31224b4d2d
Merge pull request #20112 from maribu/drivers/lpsxxx
drivers/lpsxxx: add missing sign extension
2023-11-27 16:14:39 +00:00
Gunar Schorcht
ff79f39fd5 drivers/mtd: fix the order in the MTD pointer XFA
The commit fixes the order of entries in the MTD pointer XFA `mtd_dev_xfa` according to their index by using the index as the priority in the XFA.
2023-11-27 17:14:23 +01:00
benpicco
c93a5b84a3
Merge pull request #20020 from gompper/periph/freqm
drivers/include/periph: add FREQM peripheral driver
2023-11-27 16:06:52 +00:00
Marian Buschsieweke
bf6807c85a
drivers/lpsxxx: add missing sign extension
Fixes https://github.com/RIOT-OS/RIOT/issues/20093
2023-11-27 10:17:47 +01:00
Urs Gompper
97bde07e0d drivers/periph_common: add peripheral freqm to Kconfig 2023-11-23 20:53:15 +01:00
Urs Gompper
afcd4801bd drivers/include: add header definition for freqm 2023-11-23 20:37:52 +01:00
Benjamin Valentin
138cbb83d6 drivers/soft_uart: include board.h 2023-11-23 13:45:00 +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
6380d81119
Merge pull request #20091 from benpicco/at24cs0x
drivers/at24cxxx: add defines for AT24CS04 & AT24CS08
2023-11-16 17:41:29 +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
Benjamin Valentin
63cd55cc7b drivers/mtd_default: deprecate mtd_default_get_dev() 2023-11-10 19:53:48 +01:00
Benjamin Valentin
396d3bbe2b drivers/mtd: introduce mtd_dev_get() 2023-11-10 19:53:48 +01:00
Mihai Renea
e99cafba33 drivers/at: fix URC collision with command response 2023-11-10 15:26:47 +01:00
benpicco
04617ee0a9
Merge pull request #20045 from benpicco/periph_adc_continous
periph/adc: introduce periph_adc_continuous
2023-11-10 12:13:54 +00:00
Benjamin Valentin
2421919295 periph/adc: introduce periph_adc_continous 2023-11-10 12:10:49 +01:00
Marian Buschsieweke
4b88a420ad
drivers/pcf857x: minor cleanup
- make sure format specifiers match variable arguments in debug
  statements
- drop unused headers
2023-11-10 09:57:58 +01:00
Benjamin Valentin
3889592db5 drivers/mtd_sdmmc: support mounting ext2/3/4 filesystems 2023-11-09 20:15:52 +01:00
Karl Fessel
a36802f9c7 driver/mtd: mtd_init add documentation for return value 2023-11-01 10:56:13 +01:00
Benjamin Valentin
6ec3f54b3c drivers/slipdev: improve default UART selection 2023-10-26 16:10:05 +02:00
bors[bot]
03d3874e51
Merge #19465 #19981 #19995
19465: drivers/mtd: use XFA for pointers to defined MTDs r=benpicco a=gschorcht

### Contribution description

This PR provides the support to hold pointers to defined MTDs within a XFA. The XFA allows
- to access MTDs of different types (`mtd_flashpage`, `mtd_sdcard`, `mtd_emulated`, ...) by an index
- to determine the number of MTDs defined in the system.

### Testing procedure

To be defined once PR #19443 is merged because emulated MTDs will allow to test this PR on arbitrary boards.

### Porting Guide

For external boards:
 - remove the `MTD_NUMOF` definition from `board.h`
 - add `MTD_XFA_ADD(<mtd_dev>, <idx>);` to the definition of `<mtd_dev>`.
 - `MTD_0`, `MTD_1`, … defines are no longer needed.

### Issues/PRs references

 Related to PR #19443

19981: Fletcher32: Add incremental API r=benpicco a=bergzand

### Contribution description

This PR extends the current fletcher32 checksum with an incremental API mode. This way the bytes to be checksummed can be supplied via multiple successive calls and do not have to be provided in a single consecutive buffer.

I've also rephrased the warning with the original function a bit as that function uses an `unaligned_get_u16` to access the data. The data thus does not require alignment, but the length does need to be supplied as number of 16 bit words.

### Testing procedure

The test has been extended


### Issues/PRs references

None

19995: sys/psa_crypto: Fix macro for public key max size and SE example r=benpicco a=Einhornhool

### Contribution description
#### 1. Wrong public key size when using secure elements, introduced by  #19954
Fixed conditions for key size macros in `crypto_sizes.h`.

#### 2. EdDSA and ECDSA examples fail when using a secure element because of unsopported changes introduced by #19954
Updated `example/psa_crypto` to use only supported functions for secure elements.

### Testing procedure
Build `example/psa_crypto` for secure elements and run application

Output on master:
```
2023-10-19 14:33:24,372 # main(): This is RIOT! (Version: 2019.07-devel-22378-gb6772)
2023-10-19 14:33:24,372 # HMAC SHA256 took 56393 us
2023-10-19 14:33:24,372 # Cipher AES 128 took 68826 us
2023-10-19 14:33:24,372 # *** RIOT kernel panic:
2023-10-19 14:33:24,373 # HARD FAULT HANDLER
2023-10-19 14:33:24,373 # 
2023-10-19 14:33:24,373 # *** rebooting...

```
Output with fixes:
```
2023-10-19 13:35:24,715 # main(): This is RIOT! (Version: 2019.07-devel-22384-g8ef66-dev/psa-crypto-fixes)
2023-10-19 13:35:24,715 # HMAC SHA256 took 56374 us
2023-10-19 13:35:24,715 # Cipher AES 128 took 68805 us
2023-10-19 13:35:24,715 # ECDSA took 281164 us
2023-10-19 13:35:24,715 # All Done
```


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
2023-10-19 19:01:12 +00:00
Marian Buschsieweke
edc43201db
tree-wide: fix typos in doc and comments
This should not change any generated binary
2023-10-16 12:17:48 +02:00
bors[bot]
dd62f419d7
Merge #19941
19941: drivers/lcd: add MCU-driven low-level parallel interface r=benpicco a=gschorcht

### Contribution description

The PR extends the LCD driver by a low-level interface for MCU-driven implementations of the MCU 8080 16-/8-bit parallel interface, allowing the MCU to use special peripherals for the interface, such as the FMC for STM32 MCUs, which is significantly faster than the integrated GPIO-driven parallel interface implementation of the LCD driver.

### Testing procedure

~Once PR #19938 and PR #19939 are merged, a PRs for these board can be pushed that allow to test this PR.~

Use either PR #19943 or PR #19944 on top of this PR to test, e.g. with PR #19943:
```
BOARD=stm32f723e-disco make -j8 -C tests/drivers/st77xx flash
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-10-05 09:29:41 +00:00
Gunar Schorcht
9da0cc5bfd drivers/mtd_sdmmc: use XFA with MTD pointers 2023-10-02 12:28:08 +02:00
Gunar Schorcht
e70e6d7db2 drivers/mtd_emulated: use XFA with MTD pointers 2023-10-02 12:28:08 +02:00
Gunar Schorcht
e5c541b77c drivers/mtd_sdcard: use XFA with MTD pointers 2023-10-02 12:28:07 +02:00
Gunar Schorcht
739cb53ca9 drivers/mtd_default: use XFA with MTD pointers 2023-10-02 12:28:07 +02:00
Gunar Schorcht
bd67236788 drivers/mtd: store MTD pointers as XFA 2023-10-02 12:27:35 +02:00
bors[bot]
149cee491e
Merge #19760 #19946 #19956 #19957
19760: cpu/sam0_common/periph: add low-level SDMMC peripheral driver for SDHC r=benpicco a=gschorcht

### Contribution description

This PR implements the low-level SDIO/SDMMC peripheral driver for SAM0 SDHC according to the definition in #19539.

### Testing procedure

```
BOARD=same54-xpro make -C tests/drivers/sdmmc
```
```
BOARD=same54-xpro make -C tests/sys/vfs_default
```

### Issues/PRs references

~Depends on PR #19539~
Depends on PR #19899

19946: posix_sockets.c: Fix 2 byte int compilation errors r=benpicco a=mrdeep1



19956: cpu/esp32: fix heap definition for ESP32-S2 and ESP32-S3 r=benpicco a=gschorcht

### Contribution description

For ESP32-S2 and ESP32-S3 the symbol `_heap_end` must not be used as `_eheap` for the newlibc `malloc` and function `sbrk`.

`_heap_end` is used by the ESP-IDF heap implementation `esp-idf-heap` and points to the highest possible address (0x40000000) that could be used for the heap in ESP-IDF. It doesn't point to the top address of the unused SRAM area that can be used in newlibc `malloc` and function `sbrk`. Instead, the origin and the length of `dram0_0_seg` must be used to calculate the end of the heap `_eheap`.

The problem only occurs for the newlibc `malloc` when the `sbrk` function is used but not for the ESP-IDF heap implementation `esp_idf_heap`.

### Testing procedure

Use any ESP32-S2 or ESP32-S3 board and flash `tests/sys/malloc`, e.g.
```
CFLAGS='-DCHUNK_SIZE=16384' USEMODULE='stdio_uart' BOARD=esp32s3-pros3 make -j8 -C tests/sys/malloc flash
```
Without the PR the `nm` command will give the wrong address 
```
nm -s tests/sys/malloc/bin/esp32s3-pros3/tests_malloc.elf | grep _eheap
40000000 A _eheap
```
The test will stuck, i.e. the allocation of memory stops when the top of unused SRAM is reached and the board restarts when the watchdog timer expires. With the PR it should work as expected
```
Help: Press s to start test, r to print it is ready
START
main(): This is RIOT! (Version: 2023.10-devel-309-g4669e)
calloc(zu, zu) = 0x10000000
CHUNK_SIZE: 16384
NUMBER_OF_TESTS: 3
Allocated 16384 Bytes at 0x3fc8c4b0, total 16384
...
Allocated 16384 Bytes at 0x3fcec6f0, total 409792
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403763e3
```

With this PR the `nm` command should give a address in unused SRAM address space
```
nm -s tests/sys/malloc/bin/esp32s3-pros3/tests_malloc.elf | grep _eheap
3fcca000 A _eheap
```
and the test should pass.

### Issues/PRs references


19957: cpu/esp32: fix Octal SPI RAM for ESP32-S3 r=benpicco a=gschorcht

### Contribution description

This PR fixes Octal SPI RAM handling for ESP32-S3.

Functions that are used during the initialization of the Octal SPI RAM must reside in IRAM instead of Flash. Otherwise, the system stucks during boot once the Octal SPI RAM is enabled. The reason is that the Flash is not available during the initialization of the Octal SPI RAM and the functions that are called during that initialization can't be accessed in Flash. As a result the call of such a function leads to code that is messed up and the system crashes.

The PR also includes the documentation fixe for the `esp32s3-box`. It also includes a small documentation fix regarding the SPI RAM for the `esp32s3-pros3` board.

### Testing procedure

Use a board that has Octal SPI RAM and flash `tests/sys/malloc`, e.g.:
```
CFLAGS='-DCHUNK_SIZE=16384' USEMODULE='stdio_uart esp_spi_ram esp_log_startup' \
BOARD=esp32s3-box make -C tests/sys/malloc
```
Without the PR, the system stuck during boot once the information for the Octal SPI RAM is print
```
ESP-ROM:esp32s3-20210327
...
I (133) boot: Loaded app from partition at offset 0x10000
I (134) boot: Disabling RNG early entropy source...
vendor id : 0x0d (AP)
dev id    : 0x02 (generation 3)
density   : 0x03 (64 Mbit)
good-die  : 0x01 (Pass)
Latency   : 0x01 (Fixed)
VCC       : 0x01 (3V)
SRF       : 0x01 (Fast Refresh)
BurstType : 0x01 (Hybrid Wrap)
BurstLen  : 0x01 (32 Byte)
Readlatency  : 0x02 (10 cycles@Fixed)
DriveStrength: 0x00 (1/1)
```
and the board restarts when the watchdog timer expires.

With this PR, the system starts as expected.
```
ESP-ROM:esp32s3-20210327
...
I (132) boot: Loaded app from partition at offset 0x10000
I (133) boot: Disabling RNG early entropy source...
vendor id : 0x0d (AP)
dev id    : 0x02 (generation 3)
density   : 0x03 (64 Mbit)
good-die  : 0x01 (Pass)
Latency   : 0x01 (Fixed)
VCC       : 0x01 (3V)
SRF       : 0x01 (Fast Refresh)
BurstType : 0x01 (Hybrid Wrap)
BurstLen  : 0x01 (32 Byte)
Readlatency  : 0x02 (10 cycles@Fixed)
DriveStrength: 0x00 (1/1)
Found 64MBit SPI RAM device
SPI RAM mode: sram 40m
PSRAM initialized, cache is in normal (1-core) mode.
Pro cpu up.
Single core mode
SPI SRAM memory test OK
Initializing. RAM available for dynamic allocation:
At 3FC8C150 len 00053EB0 (335 KiB): D/IRAM
At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
At 3FCF0000 len 00008000 (32 KiB): DRAM

Starting ESP32x with ID: f412fafd0f8c
ESP-IDF SDK Version v4.4.1

Current clocks in Hz: CPU=80000000 APB=80000000 XTAL=40000000 SLOW=150000
PRO cpu is up (single core mode, only PRO cpu is used)
PRO cpu starts user code
Adding pool of 8192K of external SPI memory to heap allocator
Used clocks in Hz: CPU=80000000 APB=80000000 XTAL=40000000 FAST=8000000 SLOW=150000
XTAL calibration value: 3643448
Heap free: 8754851 bytes

Board configuration:
	UART_DEV(0)	txd=43 rxd=44
	LED		pins=[ ]
	BUTTONS		pins=[ 0 ]

Starting RIOT kernel on PRO cpu
Help: Press s to start test, r to print it is ready
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2023-09-29 08:36:50 +00:00
Gunar Schorcht
ca44651d78 drivers/mtd: fix missing dependency in Kconfig for periph_sdmmc 2023-09-29 07:49:41 +02:00
Gunar Schorcht
5393c7571a drivers/sdmmc: fix dependencies for ztimer_msec
Enabling `ztimer_msec` through `sdmmc` in case `ztimer_usec` is not enabled will not work if the dependencies for `sdmmc` are resolved before the dependencies of another module that enables `ztimer_usec`. Therefore, `ztimer_msec` has to be enabled by `sdmmc`
2023-09-29 07:48:32 +02:00
Gunar Schorcht
7a4c2a526f drivers/sht3x: fix references in documentation 2023-09-27 09:12:06 +02:00
Gunar Schorcht
b73be0d546 drivers/sdmmc: add low-levl SD Host Controller implementation 2023-09-23 19:26:30 +02:00
Gunar Schorcht
e0a76c5768 drivers/lcd: add MCU-driven low-level parallel interface 2023-09-23 08:03:16 +02:00
Gunar Schorcht
0353e05bc3 drivers/lcd: move GPIO low-level interface to separate file 2023-09-23 08:03:16 +02:00
Gunar Schorcht
a73ff74b5a tests/drivers/st77xx: read ID and status 2023-09-22 17:00:00 +02:00
Gunar Schorcht
8306838424 drivers/lcd: expose lcd_ll_set_area function 2023-09-22 17:00:00 +02:00
Gunar Schorcht
4ae2e65108 drivers/st77xx: fix compilation with NDEBUG 2023-09-22 17:00:00 +02:00
bors[bot]
6bac1514c2
Merge #19937
19937: drivers/lcd: add MCU 8080 16-bit parallel mode support r=benpicco a=gschorcht

### Contribution description

This PR adds the 16-bit support for MCU 8080 parallel mode for LCD driver ICs.

### Testing procedure

Use either PR #19938
```
BOARD=stm32l496g-disco make -j8 -C tests/drivers/st77xx
```
or #19939  on top of this PR to test.
```
BOARD=sstm32f723e-disco make -j8 -C tests/drivers/st77xx
```

### Issues/PRs references

Prerequisite for PR #19938 or PR #19938

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-21 14:58:41 +00:00
Gunar Schorcht
c3006c59d0 drivers/st7735: add MCU 8080 16-bit parallel mode support 2023-09-21 13:12:03 +02:00
Gunar Schorcht
a30609ccd1 drivers/ili9341: add MCU 8080 16-bit parallel mode support 2023-09-21 13:12:03 +02:00
Gunar Schorcht
a12427fc4c drivers/lcd: add debug info to lcd_ll_write_cmd and lcd_ll_read_cmd 2023-09-21 13:00:35 +02:00
Gunar Schorcht
ad604fe6e2 drivers/lcd: implement MCU 8080 16-bit parallel mode 2023-09-21 13:00:35 +02:00
Gunar Schorcht
65d937c99d drivers/st77xx: fix init for ST7796 2023-09-21 12:14:48 +02:00
bors[bot]
1691dbe0d3
Merge #19914 #19915
19914: boards: complete SD Card MTD definition for several bords r=benpicco a=gschorcht

### Contribution description

This PR completes the MTD definition for the following boards:
- `seeedstudio-gd32`
- `sipeed-longan-nano` including `sipeed-longan-nano-tft`
- `waveshare-nrf52840-eval-kit`
- ESP32x boards that have an SPI SD Card interface and use `mtd_sdcard_default`

### Testing procedure

Green CI

### Issues/PRs references#19465 

Prerequisite for PR #19465 

19915: drivers/lcd: support MCU 8080 8-bit parallel mode r=benpicco a=gschorcht

### Contribution description

LCD driver ICs usually support
- SPI serial mode,
- MCU 8080 8-bit parallel mode and
- MCU 8080 16-bit parallel mode.

This PR extends the LCD display driver API to support the MCU 8080 8-/16-bit parallel modes and implements a GPIO-driven MCU 8080 8-bit parallel mode.

The following features are already working locally and will be provided as follow-on PRs for which this PR is a prerequisite.

- GPIO-driven bit-banging implementation of the 16-bit mode of the MCU 8080 parallel interface
- Enabling the display on `stm32f723e-disco` and `stm32l496g-disco` using the feature above
- Definition of a low-level API for the parallel modes using the LCD controller of the MCU
- Using FMC for the display on `stm32f723e-disco` and `stm32l496g-disco`
- Using LCD controller for the display of `esp32-wt32-sc01-plus` (PR #19917)

### Testing procedure

The PR can be tested with PR #19917 on top of this PR.
```
BOARD=esp32s3-wt32-sc01-plus make -j8 -C tests/drivers/st77xx flash
```
The following video shows the test.

**Please note** The test is pretty slow because the display has 480 x 320 pixels and the MCU 8080 8-bit parallel interface is realized by a GPIO-driven bit-banging implementation where each GPIO of the data bus is set separately. A follow-up PR will use the ESP32-S3 LCD controller and DMA for this board. This PR just defines the extension of the driver by the parallel interface and provides the bit-banging implementation for MCUs that don't have a LCD controller on chip.

https://github.com/RIOT-OS/RIOT/assets/31932013/c1e3e3d7-05d9-4ca5-8fff-9a5eaca50fba

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-20 15:55:34 +00:00
bors[bot]
ec69cfde6f
Merge #19919 #19931 #19935
19919: drivers/st77xx: introduce rotation defines r=benpicco a=gschorcht

### Contribution description

The PR introduces counterclockwise rotations for the definition of parameter `ST77XX_PARAM_ROTATION`.

It is more intuitive and universal to use `ST77XX_ROTATION_{0,90,180,270}` instead of `ST77XX_ROTATION_{ST77XX_ROTATION_{VERT,VERT_FLIP,HORZ,HORZ_FLIP}`, especially because the orientation of the display may vary with respect to the orientation of the board.

### Testing procedure

`tests/drivers/st77xx` should still work, for example:
```
BOARD=adafruit-pybadge make -C tests/drivers/st77xx flash
```
```
BOARD=esp32s3-usb-otg make -j8 -C tests/drivers/st77xx flash
```

### Issues/PRs references


19931: boards: fix documentation for GD32V boards and doxygen 1.9.4 r=benpicco a=gschorcht

### Contribution description

This PR fixes some small problems in documentation of `sipeed-longan-nano`, `sipeed-longan-nano-tft` and `seeedstudio-gd32` for doxygen 1.9.4 that is used on `doc.riot-os.org`.

Doxygen version 1.9.4 doesn't like anymore
- single double quotes as symbol for the inches unit in the text
- line breaks in `[]()` to avoid exhausting the 100 characters per line.

See https://doc.riot-os.org/group__boards__sipeed__longan__nano.html for example.

Doxygen 1.9.1 which is part of `riot-docker` container didn't have theses problems 😟

### Testing procedure

Documentation should be fixed.

### Issues/PRs references


19935: boards/nucleo64: fix SPI Arduino mapping for most boards r=benpicco a=maribu

### Contribution description

Before, the Arduino SPI mapping for all Nucleo-64 boards was incorrect. With this, the situation improves to the following:

- [x] nucleo-f030r8
- [ ] nucleo-f070rb
    - No SPI buses provided.
- [x] nucleo-f072rb
- [x] nucleo-f091rc
- [x] nucleo-f103rb
- [ ] nucleo-f302r8
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-f303re
- [x] nucleo-f334r8
- [x] nucleo-f401re
- [x] nucleo-f410rb
- [x] nucleo-f411re
- [x] nucleo-f446re
- [x] nucleo-g070rb
- [x] nucleo-g071rb
- [x] nucleo-g431rb
- [x] nucleo-g474re
- [x] nucleo-l053r8
- [x] nucleo-l073rz
- [x] nucleo-l152re
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-l452re
- [x] nucleo-l476rg
- [x] nucleo-wl55jc

The remaining offenders still need to be fixed, but that is better done one PR at a time.

### Testing procedure

- Check if the SPI device provided in the given `boards/<BOARD_NAME>/incude/periph_conf.h` is indeed `SPI_DEV(0)`, or in `periph_conf.h` the correct SPI dev is found
    - this should be fine for all boards above, except for the unchecked ones

or:

- run https://github.com/RIOT-OS/RIOT/pull/19932: The SPI test should pass now

### Issues/PRs references

Bug found in https://github.com/RIOT-OS/RIOT/pull/19932#issuecomment-1726305437

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-09-20 11:42:38 +00:00
Gunar Schorcht
b0ec24bc9e drivers/st7735: add MCU 8080 8-/16-bit parallel mode support 2023-09-20 13:03:36 +02:00
Gunar Schorcht
10122a7c2b drivers/ili9341: add MCU 8080 8-/16-bit parallel mode support 2023-09-20 13:03:36 +02:00
Gunar Schorcht
9dde49dd23 drivers/lcd: remove const for dev due to the mutex 2023-09-20 13:03:36 +02:00
Gunar Schorcht
04c3facd8e drivers/lcd: add MCU 8080 8-/16-bit parallel mode support
For the parallel interface support the following changes were made:

1. Additional `lcd_*` pseudomodules are defined to control whether SPI serial or MCU 8080 8-/16-bit parallel interface is used.
2. The low level function implementation was extended for parallel interfaces so that the now can use either the SPI serial interface or the MCU 8080 8-/16-bit parallel interface.

Using the `lcc_*` modules, either the SPI serial interface or the MCU 8080 8-/16-bit interface or even both for multiple display can be used simultaneously.
2023-09-20 13:03:36 +02:00
bors[bot]
e688211541
Merge #19923
19923: boards: add Silabs EFM32 Giant Gecko GG11 Starter Kit r=miri64 a=gschorcht

### Contribution description

The PR adds the support for the EFM32GG11B family and the Silabs EFM32 Giant Gecko GG11 Starter Kit board.

The Silabs EFM32 Giant Gecko GG11 has the following on-board features:

- EFM32GG11B MCU with 2 MB flash and 512 kB RAM
- J-Link USB debugger
- 176x176 RGB LCD (not supported)
- 2 user buttons, 2 user RGB LEDs and a touch slider
- Si7021 Relative Humidity and Temperature Sensor
- Si7210 Hall-Effect Sensor (not supported)
- USB OTG interface (Device mode supported)
- 32 MByte Quad-SPI Flash (not supported yet)
- SD card slot (not supported yet, follow-up PR based on PR #19760)
- RJ-45 Ethernet (not supported)
- Dual microphones (not supported)

### Testing procedure

Basic tests should work.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-19 19:10:14 +00:00
Gunar Schorcht
b34f48c233 drivers/usdev_synopsys_dwc2: enable EFM32GG11B support 2023-09-18 12:40:33 +02:00
Marian Buschsieweke
d0fccdb549
drivers/pcf857x: Move compile time check to compilation unit
This allows including the header without using the module. Obviously,
calls to the functions provided by the header won't like without using
the module. But including the header can still be useful for e.g.:

    if (IS_USED(MODULE_PCF857x)) {
        /* make use of the module */
    }

In the above example all calls to pcf857x functions would be optimized
out when the module is not used, full compile checks happen in either
case.
2023-09-15 12:52:58 +02:00
Gunar Schorcht
bdfbe6f8a6 periph/sdmmc: add ADD_CMD12 feature in Kconfig 2023-09-14 10:01:14 +02:00
Gunar Schorcht
4a6f4ad798 drivers/sdmmc: store SDMMC devs in XFA 2023-09-12 14:30:18 +02:00
Gunar Schorcht
093593a3bd drivers/st77xx: add ST77XX_ROTATION macros that are more clear 2023-09-08 12:00:47 +02:00
Gunar Schorcht
f03bc3327c drivers/lcd: rename low-level functions
To be clear that the functions are low-level functions, they are renamed to `lcd_ll_*`.
2023-09-08 08:07:09 +02:00
Gunar Schorcht
7599ce7b00 drivers/st77xx: expose configuration parameters in Kconfig 2023-09-07 16:33:31 +02:00
Gunar Schorcht
5c7a9cc966 drivers/lcd: assert controller-specific init function 2023-09-07 16:33:31 +02:00
Gunar Schorcht
9447f59d59 drivers/st77xx: fix initialization sequences fror ST77xx 2023-09-07 16:33:31 +02:00
bors[bot]
85c7bd937c
Merge #19825
19825: drivers: rename st7735 to more generic st77xx r=aabadie a=gschorcht

### Contribution description

This PR provides the following changes:
- renames the driver `st7735` to `st77xx`
- renames the test `st7735` to `st77xx`
- models controller variants as pseudomodules `st7735`, `st7789` and `st7796`
- removes the buggy initialization as a workaround to use reset defaults, see issue #19818 
- adds backward compatibility header files for `ST7735_PARAM_*` symbols
- adds a test board for compilation test of backward compatibility
- updates the corresponding board definitions

The PR should solve the remaining dependency issues in KConfig we had by using `st7735` module for different controller variants. The backward compatibility header files should work for boards that still use `ST7735_PARAM_*` in their board definitions so that the board defintions at user's side use shouldn't be affected.

~To be compilable, the PR includes PR #19824.~

### Testing procedure

- Green CI
- `tests/drivers/disp_dev` and `tests/drivers/st77xx` should still work for all boards using a ST77xx display.
- The PR was already tested for these tests for:
   - [x] `adafruit-pybadge`
   - [x] `esp32s2-lilygo-ttgo-t8`
   - [x] `esp32s3-usb-otg`
   - [x] `sipeed-longan-nano`

### Issues/PRs references

Workaround for issue #19818
Preqruisite for PR #19827 

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-06 10:19:01 +00:00
Gunar Schorcht
020861b2ea drivers/lcd.h: fixes and improvements of documentation 2023-09-06 11:52:11 +02:00
Gunar Schorcht
7f28ab8ec1 drivers/lcd.h: move doc to module section 2023-09-06 11:52:11 +02:00
Gunar Schorcht
1c2cce7c66 drivers/st77xx: add st7735 compatibility headers
If a board definition already used the ST7735 driver, `st7735*.h` header files and `ST7735_*` macros were used in the board definitions to define the default configuration parameter set. For backward compatibility these header files are kept and the `ST7735_*` macros are mapped to the `ST77XX_*` macros if they are defined.
2023-09-06 11:52:10 +02:00
Gunar Schorcht
b5a7101f5e drivers: rename st7735 driver to more generic st77xx 2023-09-06 11:52:10 +02:00
Gunar Schorcht
ef7234b455 drivers/lcd: support of controller variant parameter
If the controller-specific driver supports multiple controller variants, the variant has to be specified in the configuration parameter set.
2023-09-06 11:52:10 +02:00
bors[bot]
da7deb518b
Merge #19794 #19912
19794: drivers/periph: Add documentation on thread safety and initialization r=aabadie a=maribu



19912: drivers/at86rf215: switch example config to use EXT3 on same54-xpro  r=aabadie a=benpicco



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-09-05 12:03:37 +00:00
Marian Buschsieweke
6bf23bd683
drivers/periph: Add documentation on thread safety and initialization 2023-09-05 09:40:12 +02:00
Benjamin Valentin
05bf94492f drivers/at86rf215: switch example config to use EXT3 on same54-xpro
This avoids the conflict of using the same IRQ line (EXTI07) as the PHY
2023-09-04 16:03:40 +02:00
bors[bot]
51a39d0127
Merge #19355 #19883
19355: boards/adafruit-itsybitsy-m4: configure littleFS on external flash r=aabadie a=benpicco



19883: drivers/stmpe811: introduce conversion for X and Y coordinates r=aabadie a=gschorcht

### Contribution description

To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates by swapping and mirroring. Instead of hard coding this conversion, it is now controlled by an additional conversion parameter. For the sake of simplicity, possible rotations are predefined.

The PR fixes `tests/pkg/lgvl_touch` for the `stm32f429i-disc1`  board where the coordinates from the touch panel seem to be mirrored in relation to the screen coordinates at the vertical axis.

### Testing procedure

Flash `tests/pkg/lvgl_touch`. Without this PR the coordinates of the button don't correspond to the touch panel coordinates once the button has been pressed. Instead they seem to be mirrored at the vertical axis. With this PR, the coordinates should be correct.

### Issues/PRs references


Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-02 17:47:18 +00:00
Gunar Schorcht
ebe51e7f51 drivers/stmpe811: introduce coordinate conversion
To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates from the touch display by swapping and mirroring. For the sake of simplicity, possible rotations are additionally defined.
2023-09-02 17:01:46 +02:00
bors[bot]
99f020402b
Merge #19908
19908: drivers/mtd_spi_nor: fix init when only ztimer_msec is used r=aabadie a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-09-02 13:44:41 +00:00
bors[bot]
930811dc45
Merge #19884
19884: drivers/touch_dev_gestures: add gesture recognition for touch devices r=aabadie a=gschorcht

### Contribution description

This PR adds simple gesture recognition for touch devices accessed via the generic Touch Device API. It can be used in conjunction with device drivers that use either interrupts or polling mode. It supports up to two touches and the following gestures:
- Single and double tap at given position
- Long press and release given position
- Moving while pressed with current position
- Swipe left, right, up and down
- Zoom in (spread) and out (pinch)

Gesture recognition has been tested with:
- [x] `stm32f746g-disco` (works out of the box)
- [x] `stm32f723e-disco` (works out of the box)
- [x] `stm32f429i-disc1` (works on top of PR #19885)
- [x] `stm32l496g-disco` (works with my local LCD display changes waiting for PR #19825, not yet provided)
- [x] `esp32s3-wt32-sc01-plus` (new board, not yet provided)

### Testing procedure

Flash `tests/drivers/touch_dev_gestures` to a board with touch pane, for example:
```
BOARD=stm32f746g-disco make -j8 -C tests/drivers/touch_dev_gestures/ flash
```
PR #19885 is required for the `stm32f429i-disc1` board.

The output should look like this:
```
main(): This is RIOT! (Version: 2023.10-devel-121-g81c5c-drivers/touch_dev_gestures)
Single Tap X: 255, Y:154
Single Tap X: 253, Y:153
Double Tap X: 253, Y:149
Swipe right
Swipe down
Swipe left
Swipe up
Pressed    X: 257, Y:155
Moving     X: 257, Y:155
Moving     X: 257, Y:155
Moving     X: 259, Y:156
Moving     X: 262, Y:157
Moving     X: 266, Y:158
Moving     X: 269, Y:160
Moving     X: 273, Y:162
Moving     X: 276, Y:165
Moving     X: 278, Y:167
Moving     X: 278, Y:169
Moving     X: 278, Y:169
Released   X: 279, Y:172
```

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-01 12:57:14 +00:00
Gunar Schorcht
54ec84df88 drivers: add gesture recognition for touch devices 2023-08-31 20:12:33 +02:00
Benjamin Valentin
4f2f412c39 drivers/mtd_spi_nor: improve fallback when no timer is used 2023-08-31 15:22:33 +02:00
Benjamin Valentin
6e290fbace drivers/mtd_spi_nor: fix init when only ztimer_msec is used 2023-08-31 14:37:55 +02:00
bors[bot]
8017249bab
Merge #19885
19885: drivers/stmpe811: changes for interrupt-driven touch handling and gesture recognition r=aabadie a=gschorcht

### Contribution description

This PR contains changes needed for the purely interrupt-driven handling of the touch position as `touch_dev` device, which is a prerequisite for the realization of gesture recognition. (PR #19884).

The interrupt-driven approach of `touch_dev` devices (PR #19882) and the gesture recognition (PR #19884) need continuous reporting of the touch position as long as there is at least one touch. Since the driver so far only uses the _Touch Detect_ interrupt, only the position at the beginning of a touch is available. All further positions must be polled.

Therefore, the changes in this PR additionally enable the _FIFO Threshold_ interrupt when the `touch_dev` module is enabled. However, since the _Touch Detect_ interrupt does not work reliably when the _FIFO Threshold_ interrupt is enabled and the FIFO Threshold is 1, the FIFO Threshold is set to 2 by default when the `touch_dev` module is enabled.

Furthermore, the FIFO queue has to be reset after reading one touch position. Otherwise new touch positions are processed with a delay if the rate of calling the function to read the FIFO is slower than the rate at which the FIFO is filled. The reason for this is that with each call of this function only the oldest touch position is read value by value from the FIFO. Gestures can't be implemented with such a behavior.

### Testing procedure

1. `tests/drivers/stmpe811` should work as before (only a single position is shown):
   ```
   BOARD=stm32f429i-disco make -j8 -C tests/drivers/stmpe811 flash
   ```
   ```
   main(): This is RIOT! (Version: 2023.10-devel-120-g848d1- 
   drivers/stmpe811_touch_dev_gestures)
   STMPE811 test application
   +------------Initializing------------+
   Initialization successful
   Pressed!
   X: 135, Y:131
   Released!
   ```
2. `tests/drivers/stmpe811` should work on top of PR #19882 with continuous outputs of touch positions:
   ```
   BOARD=stm32f429i-disco make -j8 -C tests/drivers/touch_dev flash
   ```
   ```
   main(): This is RIOT! (Version: 2023.10-devel-121-g38d3db-drivers/stmpe811_touch_dev_gestures)
   Event: pressed!
   X: 131, Y:145
   X: 133, Y:141
   X: 135, Y:138
   X: 138, Y:133
   X: 141, Y:128
   X: 146, Y:122
   X: 151, Y:117
   Event: released!
   ```
3. `tests/driver/touch_dev_gestures` of PR #19884 should work on top of this PR:
   ```
   BOARD=stm32f429i-disco make -j8 -C tests/drivers/touch_dev_gestures flash
   ```
   ```
   main(): This is RIOT! (Version: 2023.10-devel-128-g05f690-drivers/touch_dev_gestures_work)
   Swipe right
   Swipe left
   Swipe down
   Swipe up
   Single Tap X: 246, Y:148
   Single Tap X: 256, Y:139
   Double Tap X: 247, Y:136
   Pressed    X: 246, Y:131
   Moving     X: 248, Y:132
   Moving     X: 250, Y:133
   Moving     X: 258, Y:135
   Moving     X: 270, Y:136
   Moving     X: 285, Y:132
   Moving     X: 300, Y:126
   Moving     X: 309, Y:122
   Moving     X: 310, Y:119
   Released   X: 310, Y:119
   ```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-08-31 06:21:40 +00:00
Gunar Schorcht
0382e10e6f drivers/stmpe811: use FIFO thresh interrupt for touch_dev by default 2023-08-30 16:52:25 +02:00
Gunar Schorcht
9aecdaf2f6 drivers/stmpe811: enable FIFO threshold interrupt
For continuous reporting of the touch position the FIFO threshold interrupt is used. This is necessary for example to implement gestures in interrupt mode. To activate the FIFO threshold interrupt and thus continuous reporting, the macro 'STMPE811_FIFO_THRESHOLD_ENABLED' must be set to 1. However, the driver only works reliably with FIFO threshold interrupts if the FIFO threshold value is at least 2. Otherwise the Touch Detect interrupt will not work correctly when a touch is released. Therefore, the FIFO threshold is set to 2 by default when `STMPE811_FIFO_THRESHOLD_ENABLED` is set. This default value can be overwritten by `STMPE811_FIFO_THRESHOLD`.
2023-08-30 16:52:25 +02:00
Gunar Schorcht
3531770689 drivers/stmpe811: reset the FIFO queue after read
The FIFO queue has to be reset after reading one touch position. Otherwise new touch positions are processed with a delay if the rate of calling the function to read the FIFO is slower than the rate at which the FIFO is filled. The reason for this is that with each call of this function always only the oldest touch position is read value by value from the FIFO. Gestures, for example, can't be implemented with such a behavior
2023-08-30 16:52:25 +02:00
Benjamin Valentin
aef1a718c0 drivers/mtd_default: fix for boards that define MTD_NUMOF 2023-08-29 15:45:46 +02:00
bors[bot]
5cf32002f5
Merge #19880
19880: drivers/ft5x06: fix initialization if callback function parameter is NULL r=aabadie a=gschorcht

### Contribution description

This PR fixes the `ft5x06` driver initialization if the callback function parameter `cb` is `NULL. This might be the case for example if the application uses the touch device in polling mode.

If the interrupt pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.

To be able to test the polling mode, this PR also includes a change of the `tests/drivers/ft5x06` application which introduces the environment variables `FT5X06_POLLING_MODE` `FT5X06_POLLING_PERIOD` and in the makefile.

### Testing procedure

1. Use any board with a FTXXXX touch device and test it in polling mode, for example:
   ```
   FT5X06_POLLING_MODE=1 BOARD=stm32f746g-disco make -C tests/drivers/ft5x06 flash term
   ```
   It should work as expected.
   ```
   main(): This is RIOT! (Version: 2023.10-devel-119-g92a44a-drivers/ft5x06_fix_cb_null)
   FT5x06 test application
   +------------Initializing------------+
   Initialization successful
   1 touch detected
   Touch 1 - X: 236, Y:111
   Touch 1 - X: 236, Y:111
   ...
   Touch 1 - X: 236, Y:111
   Released!
   ```

2. Checkout master branch and cerry-pick commit 691a5e6308426ddc685e5a2c297238529211c258. The test application `tests/drivers/ft5x06` will crash once a touch event occur:
   ```
   +------------Initializing------------+
   Initialization successful
   1 touch detected
   Context before hardfault:
   ```

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-08-29 08:19:52 +00:00
Gunar Schorcht
bf720c0b41 drivers/ft5x06: configure interrupt mode in any case
The interrupt mode has to be configured independent on whether the INT pin is initialized already by the `ft5x06_init` function if parameter `cb` is defined or later, for example by the `touch_dev` implementation.
2023-08-28 18:50:04 +02:00
bors[bot]
da88c4169f
Merge #19906
19906: netdev/ieee802154_submac: support setting promiscuous mode option r=aabadie a=geonnave



### Contribution description

Found this was missing when trying to use `examples/sniffer` with the `nrf52840dk`. The solution was actually provided by `@benpicco` on the matrix channel.


### Testing procedure

Use the `examples/sniffer` following its README.


### Issues/PRs references

N/A.

Co-authored-by: Geovane Fedrecheski <geonnave@gmail.com>
2023-08-28 07:24:49 +00:00
Gunar Schorcht
ca6760047c drivers/ft5x06: introduce coordinate conversions
To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates from the touch display by swapping and mirroring. For the sake of simplicity, possible rotations are additionally defined.
2023-08-26 17:49:29 +02:00
Gunar Schorcht
7ac2865f7e drivers/ft5x06: init INT pin only if callback is defined
If the INT pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.
2023-08-25 17:35:23 +02:00
Geovane Fedrecheski
7c0accb4f1 netdev/ieee802154_submac: support setting promiscuous mode option 2023-08-25 16:20:27 +02:00
bors[bot]
ce0ae8fc73
Merge #19866
19866: drivers/ft5x06: use a pointer to config parameters instead of copying them r=benpicco a=gschorcht

### Contribution description

There is no need to copy the configuration parameter set to the device descriptor. A const pointer to the configuration parameter set in ROM is sufficient. It saves 16 byte of RAM.

Includes PR #19860 for the moment to be compilable.

### Testing procedure

Use 
```
CFLAGS='-DNDEBUG' BOARD=stm32f723e-disco make -j8 -C tests/drivers/touch_dev/
```
with and w/o this PR and compare the sizes.

Without the PR the sizes are:
```
  text	   data	    bss	    dec
  14652	    136	   2704	  17492
```
With the PR the sizes are:
```
  text	   data	    bss	    dec
  14676	    136	   2688	  17500
```

### Issues/PRs references

~Depends on PR #19860~


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-08-24 10:21:07 +00:00
bors[bot]
d1edbd94d6
Merge #19881 #19892
19881: drivers/stmpe811: fix initialization if callback function parameter is NULL r=benpicco a=gschorcht

### Contribution description

This PR fixes the `stmpe811` driver initialization if the callback function parameter `cb` is `NULL. This might be the case for example if the application uses the touch device in polling mode.

If the interrupt pin is initialized if the callback function parameter `cb` is `NULL`, the driver crashes the first time an interrupt is triggered. Therefore, the INT pin must be initialized only if also the callback function parameter `cb` is not `NULL`.

To be able to test the polling mode, this PR also includes a change of the `tests/drivers/stmpe811` application which introduces the environment variables `STMPE811_POLLING_MODE` `STMPE811_POLLING_PERIOD` and in the makefile.

### Testing procedure

1. Use a `stm32f429i-disc1` board and test it in polling mode:
   ```
   STMPE811_POLLING_MODE=1 BOARD=stm32f429i-disc1 make -C tests/drivers/stmpe811 flash term
   ```
   It should work as expected.
   ```
   main(): This is RIOT! (Version: 2023.10-devel-119-g26e7a-drivers/stmpe811_fix_cb_null)
   STMPE811 test application
   +------------Initializing------------+
   Initialization successful
   Pressed!
   X: 113, Y:135
   X: 113, Y:135
   X: 113, Y:136
   Released!
   ```

2. Checkout master branch and cerry-pick commit 691a5e6308426ddc685e5a2c297238529211c258. The test application `tests/drivers/stmpe811` will crash once a touch event occur:
   ```
   main(): This is RIOT! (Version: 2023.10-devel-117-g91441)
   STMPE811 test application
   +------------Initializing------------+
   Initialization successful
   Stack pointer corrupted, reset to top of stack
   FSR/FAR:
    CFSR: 0x00020000
    HFSR: 0x40000000
    DFSR: 0x00000008
    AFSR: 0x00000000
   Misc
   EXC_RET: 0xfffffff1
   *** RIOT kernel panic:
   HARD FAULT HANDLER
   ```

### Issues/PRs references

19892: pkg/tinydtls: allow to set buffer size from application again r=benpicco a=leandrolanzieri

### Contribution description

Currently the buffer size on tinydtls is set in its Makefile whenever `gcoap` module is present. This limits the ability of the user to override the value. This adds a pre-check of the `CFLAGS` to see if it was set before.

### Testing procedure

Try setting `CFLAGS += -DDTLS_MAX_BUF=<some_value>` on `examples/gcoap_dtls`, you should be able to override the default value without errors.


### Issues/PRs references
Reported in #19838


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2023-08-23 22:43:56 +00:00
Gunar Schorcht
d88e46b3d5 drivers/ft5x06: use a const pointer to params instead of a copy
There is no need to copy the configuration parameter set to the device descriptor. A const pointer to the configuration parameter set in ROM is sufficient. It saves some 16 byte of RAM.
2023-08-23 23:36:39 +02:00
bors[bot]
2a4496b32a
Merge #19539 #19815 #19860 #19886
19539: drivers/periph_sdmmc: define a High-level SDIO/SD/MMC API and low-level SDMMC periperal driver interface r=benpicco a=gschorcht

### Contribution description

This PR provides a SDIO/SD/MMC Device API (SDMMC). It implements a SD host controller driver that provides a high-level functions using a low-level SDIO/SD/MMC peripheral driver for accessing

- MultiMediaCards (MMC) and Embedded MultiMediaCards (eMMC)
- SD Memory Cards (SD Cards) with Standard Capacity (SDSC), High Capacity (SDHC) or Extended Capacity (SDXC).

It supports:

- 1-bit, 4-bit and 8-bit data bus width
- Default Speed and High Speed
- Auto-CLK

The SDIO/SD/MMC device API (SDMMC) is divided into two parts:

1. The high-level API that implements the SD Host Controller driver and allows
   - to inititialize and identify different types of cards,
   - to access them either blockwise or bytewise,
   - to get information about the used card, and
   - to send single commands or application specific commands to the card.

2. The low-level SDIO/SD/MMC peripheral driver implements the low-level functions required by the high-level device API. It has to be implemented for each MCU.

### Limitations:

- Only one card per SDIO/SD/MMC device is supported.
- eMMCs specific features are not supported.
- UHS-I, UHS-II and UHS-III are not supported.

### Testing procedure

PR #19540, PR #19760 or PR #19786 is needed to test this PR.

### Issues/PRs references

Prerequisite for PR #19540
Prerequisite for PR #19760
Prerequisite for PR #19786

19815: cpu/sam0_common/periph/sdhc: busy waiting and clock fixes r=benpicco a=benpicco



19860: drivers/ft5x06: fix vendor ID for FT6xx6 and FTxxxx register addresses r=benpicco a=gschorcht

### Contribution description

This PR provides a fix of the vendor ID for FT6xx6 touch panel driver ICs and a fix of register addresses for FTxxxx.

According to the [Application Note for FT6x06 CTPM](https://cdn-shop.adafruit.com/datasheets/FT6x06_AN_public_ver0.1.3.pdf), the vendor ID of FT6x06 touch panel driver ICs is `0x11` instead of `0xcd`. Although there are no information found in the Web about the FT6x36, the FT6336U touch panel of a ESP32-S3 WT32 SC01 Plus is also working with `0x11` as vendor ID so that it seems that FT6x36 is also using `0x11` as vendor ID.

Figured out with a `stm32f723e-disco` board (revision D03). Without this PR, `tests/drivers/ft5x06` gives:
```
+------------Initializing------------+
[ft5x06] init: invalid vendor ID: '0x11' (expected: 0xcd)
[Error] Initialization failed
```
With this PR it works as expected.
```
+------------Initializing------------+
Initialization successful
main(): This is RIOT! (Version: 2023.10-devel-96-gbb9011-drivers/ft5x06_fix_vendor_id)
FT5x06 test application

+------------Initializing------------+
[ft5x06] init: configuring touchscreen interrupt
Initialization successful
1 touch detected
[ft5x06] read gesture_id '0x00'
Touch 1 - X: 151, Y:138
[ft5x06] read gesture_id '0x00'
```

Some background information found in the Web:

- According to the [STM32CubeF7](c20e6dd15b/Drivers/BSP/STM32F723E-Discovery/stm32f723e_discovery_ts.c (L24-L27)) the FRIDA LCD panel mounted on the `stm32f723e-disco` board either uses FT6x36 (prior revision D) or FT3x67 (revision D). However, the FT5x06 driver type for the card is defined as FT6x06, which does not seem correct: bb9011c3fb/boards/stm32f723e-disco/include/board.h (L59)
- According to the [STM32CubeF7](c20e6dd15b/Drivers/BSP/Components/ft6x06/ft6x06.h (L269-L270)), the vendor ID for FT6x36 should be `0xcd`. However, the FT6336U on ESP32-S3 WT32 SC01 Plus works with vendor ID `0x11`.
- The [Adafruit FT6206 library](95118cd983/Adafruit_FT6206.h (L28)) uses `0x11` as vendor id.
- The `stm32l496g-disco` board uses a FT6236 which has vendor ID `0xcd`.

So the information available on the web is confusing. Maybe, a better solution would be to accept `0x11` as well as `0xcd` as vendor ID for FT6xxx touch panels. Unfortunately, there are no documents available on the registers directly from FocalTech 😟 so it seems to be more speculation than knowledge.

### Testing procedure


### Issues/PRs references



19886: cpu/efm32: fix DAC configuration r=benpicco a=gschorcht

### Contribution description

The EFM32 MCU allows the reference voltage to be configured per DAC device, not per DAC channel. Also, the DAC reference voltage was defined in the configuration but not used anywhere.

At the moment we have only defined one board (`stwstk6220a`) that uses the DAC, so changing the configuration interface shouldn't be critical.

### Testing procedure

`tests/periph/dac` should still work for the `stwstk6220a`
```
BOARD=slwstk6220a make -j8 -C tests/periph/dac flash
```
I don't have a `stwstk6220a` board (EFM32 Series 0) so that I can't test it. I could only test it for the `sltb009a` board (EFM32 Series 1) with the change for VDAC in PR #19887.

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-08-23 16:55:09 +00:00