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

69 Commits

Author SHA1 Message Date
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
smlng
0b9a54f184 cpu/kinetis: suppress selfAssignement warning by cppcheck
cppcheck raises a warning due to self assignment. As this is
    intentional to clear all IRQ on register status flags, this
    warning is suppressed now.
2018-07-25 12:01:40 +02:00
Joakim Nohlgård
31b461d71c kinetis: Interrupt based I2C transfers 2018-07-25 12:01:39 +02:00
Joakim Nohlgård
175f398b58 kinetis: Refactor I2C driver 2018-07-25 12:01:39 +02:00
Joakim Nohlgård
28fe4b8653 kinetis: Clean up SPI module power handling
Fixes a problem with hardware CS when using slow SPI speeds,
mentioned in https://github.com/RIOT-OS/RIOT/issues/6437#issuecomment-283114795
2018-06-27 19:21:39 +02:00
938677cc83 cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Francisco Acosta
9a0f3469b7
Merge pull request #8930 from gebart/pr/kinetis-rtt-refactor
kinetis: Refactor RTT driver
2018-05-30 14:54:15 +02:00
Francisco Acosta
6e484f7aed
Merge pull request #8814 from gebart/pr/kinetis-periph-timer-tfc
cpu/kinetis: Refactor LPTMR timer implementation
2018-05-29 15:54:11 +02:00
Loïc Dauphin
b7a8ba73a9
Merge pull request #8933 from gebart/pr/kinetis-pit-refactor
kinetis: Refactor PIT timer driver implementation
2018-05-29 11:09:55 +02:00
Joakim Nohlgård
09e0e8953d kinetis: GPIO: Enable the correct IRQn on CM0+ 2018-05-24 23:54:56 +02:00
Joakim Nohlgård
fb73067494 kinetis: Refactor PIT driver
Stop prescaler instead of counter channel to avoid the need for saving
and restoring timeouts
2018-05-22 16:47:35 +02:00
Joakim Nohlgård
16af9b0beb kinetis: Clean up PIT timer implementation 2018-05-22 16:47:23 +02:00
Joakim Nohlgård
c7801e466d kinetis: Refactor RTT driver
- Keep counter value between resets
- Let kinetis_mcg_init manage the RTC oscillator, to avoid disrupting
  the core clock in certain configurations
- Remove some unnecessary macros for hardware abstraction; all Kinetis
  CPUs which have an RTC only have a single RTC instance, and the ISRs
  and hardware registers are named the same way in all Kinetis CPU
  headers.
2018-05-22 16:46:39 +02:00