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

81 Commits

Author SHA1 Message Date
Marian Buschsieweke
c2c2cc8592
drivers/periph_gpio: let gpio_read() return bool
Since https://github.com/RIOT-OS/RIOT/pull/20935 gpio_write()
uses a `bool` instead of an `int`. This does the same treatment for
`gpio_read()`.

This does indeed add an instruction to `gpio_read()` implementations.
However, users caring about an instruction more are better served with
`gpio_ll_read()` anyway. And `gpio_read() == 1` is often seen in
newcomer's code, which would now work as expected.
2024-10-23 13:24:09 +02:00
Benjamin Valentin
4627f66caa drivers/periph/gpio: make gpio_write() take a bool 2024-10-22 16:39:48 +02:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
Marian Buschsieweke
f52e20c248
cpu/kinetis: implement periph_timer_query_freqs 2023-12-07 16:17:31 +01:00
c6c31f0361
boards/kinetis: replace GPIO_UNDEF with SPI_CS_UNDEF 2022-01-06 12:34:09 +01:00
Francisco Molina
bf05468fab cpu/kinetis/rtt: remove callback on clear 2021-12-14 13:20:36 +01:00
Leandro Lanzieri
421bc95cc6
cpu/kinetis: model Kconfig 2021-12-07 11:32:16 +01:00
Marian Buschsieweke
b433183e0e
cpu/kinetis: silence -Wcast-align 2021-12-03 10:12:34 +01:00
Gunar Schorcht
007e29ebb5 cpu/periph/i2c: update implementations to new I2C API
Make all `spi_acquire` implementations return `void` and add assertions to check for valid device identifier where missing.
2021-11-29 06:35:25 +01:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Marian Buschsieweke
f04b522601
cpu/periph_spi: update implementations to new API
Make all spi_acquire() implementations return `void` and add assertions to
check for valid parameters, where missing.
2021-09-01 21:38:40 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Francisco Molina
d9ee424b7c
cpu/kinetis: use LPTMR as rtt backend 2021-06-15 08:29:09 +02:00
Francisco Molina
92924ccad7
kinetis/rtc: use RTC directly 2021-06-11 17:21:01 +02:00
Leandro Lanzieri
2cf3c603c7
cpu/kinetis/timer: consider no LPTMR when no config present 2021-01-12 15:31:37 +01:00
f85594eb55
kinetis: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
benpicco
d0521af974
Merge pull request #9012 from gebart/pr/frdm-kl43z
frdm-kl43z: NXP Kinetis FRDM-KL43Z development board
2020-10-26 00:06:46 +01:00
Joakim Nohlgård
dc84ccdfe0 kinetis: Add support for MCG_Lite hardware
MCG_Lite is used in many KL parts and is a less advanced clock generator
than the full MCG used in the K series. This change lets the MCG_Lite
and MCG share the same user facing API, with some configuration
differences.
2020-10-24 22:12:32 +02:00
Joakim Nohlgård
9ea0ceca9c kinetis: Add support for combined GPIO PORTC,D IRQs
Used in KL43 and others
2020-10-24 22:08:00 +02:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +02:00
Bas Stottelaar
bd34cf8fc0 cpu/*: reorder ENABLE_DEBUG after last include 2020-10-23 00:45:55 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Benjamin Valentin
e2addab7f0 cpu/kinetis: RTC use rtc_mktime()
Use RTC helper functions instead of libc functions.
This gives us y2038 safety by the extended epoch
and saves a good chunk of memory:

mktime():

   text	   data	    bss	    dec	    hex	filename
  24756	    232	   2736	  27724	   6c4c	testssperiph_rtc/bin/openlabs-kw41z-mini/tests_periph_rtc.elf

rtc_mktime():

   text	   data	    bss	    dec	    hex	filename
  16348	    132	   2696	  19176	   4ae8	tests/periph_rtc/bin/openlabs-kw41z-mini/tests_periph_rtc.elf
2020-08-27 23:16:02 +02:00
Thomas Stilwell
ae7ec96731 cpu/kinetis: implement power modes for pm_layered 2020-06-21 21:51:16 -05:00
Marian Buschsieweke
7387cd43d9
cpu/kinetis/periph: adc_sample() now returns int32_t 2020-01-10 14:13:14 +01:00
francisco
7d11e40eac cpu/kinetis: add flashpage for W & K series 2020-01-03 09:57:24 +01:00
3eea508695 cpu/kinetis: fix typos 2019-11-23 22:39:36 +01:00
Gunar Schorcht
02d81b717e
Merge pull request #12063 from maribu/i2c_release
drivers/periph/i2c: Updated i2c_release() to return void
2019-10-01 19:50:38 +02:00
Sebastian Meiling
84e6d1571a cpu/kinetis: adapt timer to return 0 on success
Adapt periph/timer implementation of kinetis based MCUs
to return 0 on success for all functions.
2019-09-11 13:46:15 +02:00
benpicco
b6fe0e25fe
Merge pull request #10020 from gebart/pr/kinetis-lptmr-reload
kinetis: lptmr reload instead of spinning
2019-09-11 10:12:58 +02:00
Marian Buschsieweke
6b7d27ece9
cpu/kinetis: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
MrKevinWeiss
ec62f1ccce cpu/kinetis/i2c: Suppress cppcheck unreadVariable warning
On cppcheck 1.82 it throws a warning.
Since it costs cycles and does nothing the ++dummy is (void)dummy.
A warning suppression is added so the CI is happy.
2019-06-21 12:29:14 +02:00
MrKevinWeiss
6419a7a3aa cpu/kinetis/i2c: Fix false positive for expected EIO during i2c write
This fixes the positive result when master write data is NACKed.
This false positive occurs when the write frame is finished but a data nack occurred.
The AF check should occur first.
2019-06-20 16:32:25 +02:00
Anton Gerasimov
19d2ef736c kinetis: limit scope of a variable in ics.c to make Codacy happy
Signed-off-by: Anton Gerasimov <tossel@gmail.com>
2019-01-26 15:53:05 +01:00
Anton Gerasimov
40bcfc9211 kinetis: add support for S9KEAZ128
Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com>
2019-01-26 15:53:05 +01:00
Thomas Stilwell
3ea75d1314 cpu/kinetis/rtt: clear subseconds when writing seconds 2019-01-13 17:43:19 -08:00
Joakim Nohlgård
fa3b9168a0 kinetis: lptmr reload instead of spinning
Spinning for the correct time has the side effect that it may cause
infinite recursion if the callback function calls timer_set.

timer_set->callback->...->timer_set->callback->...->timer_set-> infinity

In theory, the drawback is that the callback for very short timeouts
(<2 lptmr ticks) may be delayed up to 2 lptmr ticks (61 µs)

In practice however, tests performed using tests/bench_timers shows that
this change only affects the accuracy of the timer target when timer_set
is called with a timeout of 0, which results in a delay of 30 µs.
2018-12-14 12:01:39 +01:00
Joakim Nohlgård
158a8300c4 kinetis: LPUART: Compute oversampling rate at init
By not forcing a fixed oversampling rate we can achieve better baud rate
accuracy than otherwise possible.
For example, when requesting 115200 with a module clock of 4 MHz,
picking an oversampling rate of 17 (instead of hardware
default 16) yields 117647 baud instead of 125000 baud as the best
matching rate. Better matching baud rate between receiver and
transmitter results in a lower probability of transmission errors.
2018-11-29 14:24:16 +01:00
Joakim Nohlgård
8bb73f237d kinetis: GPIO: avoid dup calls to cortexm_isr_end on KW41Z
Devices with combined IRQs would call the cortexm_isr_end handler twice
when it is part of the irq_handler routine.
2018-11-08 14:52:10 +01:00
Joakim Nohlgård
b9ceac5ccc kinetis: Optimize GPIO IRQ handler
Measurements show that the time from pin edge until return from
interrupt is reduced from 22 us to 6.1 us for KW41Z running at
41.94 MHz. The measurements used a no-op GPIO callback for testing and
were measured using an external logic analyzer.
2018-11-08 14:52:10 +01:00
Martine Lenders
53a9797e56 kinetis: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:11:00 +02:00
Joakim Nohlgård
7a857a939c
Merge pull request #9807 from gebart/pr/kinetis-adc-average
kinetis: ADC: Add hardware averaging configuration
2018-09-26 12:54:29 +02:00
Hauke Petersen
e71281943a cpu/kinetis/gpio: use gpio_irq feature 2018-09-26 09:53:30 +02:00
smlng
59e299635b cppcheck: add/correct reason for cppcheck-suppress
Adding and correcting description/rational on why certain cppcheck
warnings or errors are intentionally suppressed.
2018-09-25 12:03:58 +02:00
Joakim Nohlgård
dd2fad6b9b kinetis: ADC: Add hardware averaging configuration
This allows a board configuration to select which kind of averaging
should be applied to the pin instead of always using 32 sample average.
Very high impedance sources may need to disable hardware averaging in
order to give correct values, the on-chip temperature sensor is one such
signal source.
2018-09-12 16:32:48 +02:00
Martine Lenders
426cfbeea6 kinetis: timer: #ifdef unused functions
Another issue revealed by compiling several apps with LLVM/clang for
the `teensy31` board.
2018-08-13 18:38:13 +02:00
Martine Lenders
376c10feff kinetis: uart: fix unused-function warning
When compiling with LLVM (should also be seen `-Wunused-function` in
GCC), I get an error for `frdm-k22f`. This should fix that.
2018-08-08 10:02:53 +02:00