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

164 Commits

Author SHA1 Message Date
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
870385530d kinetis: Allow override of FOPT setting in fcfield.c 2018-11-28 00:21:35 +01:00
Joakim Nohlgård
d63672798e kinetis: Allow FOPT settings other than 0xff
These bits configure some early boot options and may be necessary to
use on certain boards to ensure a robust boot sequence.
2018-11-27 16:00:42 +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
Joakim Nohlgård
8996cbe313 make: Introduce new feature flag periph_gpio_irq 2018-08-29 08:53:20 +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
3ac45b5aa2 kinetis: Reflow text in doc.txt 2018-07-25 12:01:38 +02:00
Joakim Nohlgård
172af17ae4 kinetis: Conditionally enable MCG 2018-06-30 19:14:59 +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
a6c30ab61d kinetis: Move RTT config to periph_cpu.h 2018-05-22 16:46:39 +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
Joakim Nohlgård
9e10cd4401 cpu/kinetis: Refactor LPTMR driver implementation
Uses timer freerunning counter mode (TFC) and updating an internal
reference point instead of relying on RTT for reference time. The
target accuracy has been greatly improved for all test cases in
bench_periph_timer
2018-05-22 16:45:41 +02:00
Joakim Nohlgård
179e8505ba kinetis: Const ISR vector padding
Fixes misleading .data usage in size output because the .vectors section
is now properly marked as read-only in the ELF file.
2018-05-09 00:32:28 +02:00
Joakim Nohlgård
321aa567d6 kinetis: Memory segment attribute fixes
vectors and flashsec memory segments will not be considered for orphan
sections if rx is only given for the rom segment.
2018-05-05 08:11:00 +02:00
Joakim Nohlgård
c54f6b4fcf kinetis: Refactor clock generator initialization 2018-04-17 06:59:22 +02:00
Gaëtan Harter
fff5810191 Makefile.include: FIX .DEFAULT_GOAL not being all
.DEFAULT_GOAL was reset many times which removed 'all' from being the default
goal.
By chance it was then set to `link` so was working by some magic.
2018-03-28 16:59:00 +02:00
Hauke Petersen
47a500d0b1
Merge pull request #8447 from haukepetersen/opt_test_periphuartpower
tests/periph_uart: included power_on/off() in test
2018-03-05 09:49:20 +01:00
Joakim Nohlgård
68ea6b3316 kinetis: Add support for NXP Kinetis KW41Z SoC 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
2090dd0234 kinetis: Add GPIO ISR for CPUs with combined PORTB+PORTC interrupt 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
8642c8ceb8 kinetis: Support CM0+ devices with 96 bit UID 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
005b4bfbb3 kinetis: Filter out PWM code if no FTM exists 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
11361ec7e1 kinetis: Add support for CPUs with a single IRQ for all PIT channels 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
2b64452c33 kinetis: GPIO workaround for missing open drain support 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
a196bb431d kinetis: Only configure PWM settings if the FTM device exists 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
ba76402d03 kinetis: Add Bit Manipulation Engine helpers 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
18908667a3 kinetis: Make open drain GPIO availability depend on CPU header 2018-03-02 15:38:39 +01:00
Joakim Nohlgård
2bdf0bfbf1 kinetis: Align definitions in cpu_conf_kinetis.h 2018-03-02 14:39:00 +01:00
Joakim Nohlgård
82e960b642 kinetis: Set LPUART clock source during uart_lpuart_init 2018-03-02 14:39:00 +01:00
Francisco Acosta
2e701bd535
Merge pull request #8725 from gebart/pr/kinetis-errata-func
kinetis: Move errata workarounds to separate function
2018-03-02 12:30:16 +01:00
Francisco Acosta
a31940eee4
Merge pull request #8723 from gebart/pr/kinetis-periph-cpu-doc-fix
kinetis: periph_cpu.h doc fix
2018-03-02 12:03:06 +01:00
Hauke Petersen
8ac3465ba7 cpu/kinetis: add empty uart/power_x functions 2018-03-02 10:53:55 +01:00
Joakim Nohlgård
fd76e5ddad kinetis: Move errata workarounds to separate function 2018-03-02 08:17:00 +01:00
Joakim Nohlgård
f5edf56be4 kinetis: periph_cpu.h doc fixes 2018-03-02 08:06:46 +01:00
Joakim Nohlgård
a11c66382f kinetis: Add dependency on rtt for LPTMR time base 2018-03-02 07:37:14 +01:00
Gaëtan Harter
04e180dd3d
Merge pull request #8719 from gebart/pr/kinetis-lpuart-align
kinetis: Align defines in uart.c
2018-03-01 17:58:37 +01:00
Joakim Nohlgård
8f3fb59840 kinetis: Align defines in uart.c 2018-03-01 17:12:54 +01:00
Joakim Nohlgård
d8c80e245a kinetis: Fix shiftTooManyBitsSigned warning in GPIO driver 2018-03-01 14:35:22 +01:00
Joakim Nohlgård
b61eeb9fe0 kinetis: Allow per-board config of ADC ref
ADC reference can be external pin or internal VREF module on most
Kinetis CPUs.
2018-02-14 15:16:41 +01:00
Loïc Dauphin
982f36cdb0 cpu/kinetis: add support of MK20D7 2018-01-17 18:13:59 +01:00
smlng
b283b7784c make: fix various compile errors with Wextra
pkg, nordic_softdevice_ble: disable CFLAGS to omit compiler error
        sys, pm_layered: fix casting nonscalar to the same type
        cpu, stm32_common: fix type-limits, remove always true assert
        cpu, stm32f4: fix pointer arithmetic in periph/i2c
        drivers, at86rf2xx: fix type-limits where condition always true
        saul, gpio: fix if no gpio configured for saul
        cpu, saml21: add frequency check to periph/timer
        driver, cc110x: fix unused param and type-limts errors
        boards, wsn430-common: fix old-style-declaration
        make: fix old style definition
        drivers, sdcard_spi: fix old style typedef
        driver, at30tse: remove unnecessary check
        driver, nrf24: fix type-limit
        driver, pn532: change buffer from char to uint8_t
        tests/driver_sdcard: fix type limits
        boards, feather-m0: add missing field inits
        driver, tcs37727: fix type limits
        pkg, emb6: disable some compiler warnings
        tests/emb6: disable some compiler warings
        pkg, openthread: fix sign compare and unused params
        tests/trickle: fix struct init
        tests/pthread_cooperation: fix type limits
        board, mips-malta: remove feature periph_uart
        shell: fix var size for netif command
        gnrc, netif: fix sign-compare
        gnrc, nib: fix sign-compare
        shell: fix output in netif command
        posix: fix type-limits in pthread_cond
2017-11-28 18:31:43 +01:00
smlng
7309171303 build: fix unused parameter errors
cpu, sam0_common: fix unused parameter in periph/spi
        cpu, kinetis_common: fix unused parameter in periph/spi
        cpu, cc2538: fix unused param in periph/i2c
        cpu, cc2538: fix unused param in periph/spi
        cpu, sam3: fix unused param in periph/spi
        cpu, stm32_common: fix unused param in periph/pm
        cpu, stm32f3: fix unused params in periph/i2c
        cpu, nrf5x_common: fix unused param in periph/gpio
        cpu, nrf5x_common: fix unused param in periph/spi
        cpu, lpc2387: fix unused params in periph/spi
        cpu, cc2538: fix unused params in radio/netdev
        cpu, cc2650: fix unused params in periph/uart
        cpu, lm4f120: fix unused param in periph/spi
        cpu, lm4f120: fix unused params in periph/timer
        cpu, lm4f120: fix unused params in periph/uart
        cpu, stm32_common: fix unused params in periph/dac
        cpu, stm32l0: fix unused params in periph/i2c
        cpu, msp430fxyz: fix unused params in periph/uart
        cpu, mips: fix unused params
        cpu, cc430: fix unused-params in periph/timer
        cpu, msp430fxyz: fix unused params in periph/spi
        drivers, cc2420: fix unused param
        cpu, mips32r2_common: fix unused params in periph/timer
        cpu, cc2538: fix unused-param in periph/i2c
        cpu, mips32r2_common: fix unused-param in periph/timer
        cpu, msp430fxyz: fix unused params in periph/timer
        cpu, atmega_common: fix unused params in periph/spi
        driver, nrfmin: fix unused params
        cpu, cc2538_rf: fix unused params
        driver, netdev_ieee802514: fix unused param
        cpu, mip_pic32m: fix unused params
        cpu, lpc2387: fix unused params in periph/pwm
        tests/driver_sdcard_spi: fix unused params
        cpu, sam3: fix unused param in periph/pwm
        tests/driver_dynamixel: fix unused params, and style issues
        cpu, cc430: fix unused param in periph/rtc
        cpu, atmega_common: fix unused params in periph/i2c
2017-11-28 14:36:01 +01:00
Joakim Nohlgård
e3d5a70e0c cpu/cortexm: Remove leftover _estack declarations
These are leftovers from before the Cortex-M common ISR vectors were
split into vectors_cortexm.c
2017-11-10 15:38:14 +01:00
Joakim Nohlgård
33e751e8a8 kinetis: Remove periph driver xxx_NUMOF guards 2017-11-10 10:43:00 +01:00
Joakim Nohlgård
925a908d95 kinetis: Update RNGA driver configuration to automatically detect the module 2017-11-10 10:43:00 +01:00
Joakim Nohlgård
19d407a3e9 kinetis: Add script for generating vendor header include lines 2017-11-10 10:42:59 +01:00
Joakim Nohlgård
22c52bd3a8 kinetis: Unify all Kinetis CPUs in one directory 2017-11-10 10:42:59 +01:00