This is a rewrite of the Kinetis GPIO driver which follows the
refactored API in [1]. Pins are specified using the GPIO_PIN(PORT_x, y)
macro, e.g. GPIO_PIN(PORT_E, 25) for the PTE25 pin.
The interrupt pin handling is now implemented as a linked list, this
is more memory efficient, but with a minor variation in interrupt
latency depending on in what order the pins were initialized at
runtime.
Because the linked list entries are taken from a shared pool, there is
also the possibility of running out of available configuration slots,
define the preprocessor macro GPIO_INT_POOL_SIZE in periph_conf.h if
you need more than 16 pins configured for interrupts in the same
application.
[1]: https://github.com/RIOT-OS/RIOT/pull/3095
It simplifies the virtual "count up timer" and improves
the accuracy a little. The LDVAL for the prescaler should
be set as a number of prescaler cycles-1. The virtual
up-counter should be corrected in the isr by +1
(See PIT reference manual). This also fixes a bug where
the timer is not used by xtimer and up-counter does not overflow.
Reading CVAL after stopping timer seem to return zero.
Ref. manual states: "The counter period can be restarted, by first
disabling, and then enabling the timer with TCTRLn[TEN]", but does not
state whether the reset of CVAL happens on TEN 0->1 transition, or 1->0
transtion. Empirical evidence suggests the latter is the implemented behaviour.
The ARBL flag signals that bus master arbitration has been lost.
This may occur if devices on the bus misbehave, or in a multi-master
situation, or if devices are not powered and pull the SDA line down, or
if the communication wires are disconnected while communicating.
- Merged the two kinetis_common ldscripts into a single script.
- Updated cpus to use the new script
- Updated K60 to merge sram_l and sram_u into one segment
- Use hwtimer_set for hwtimer_set_absolute()
- Collect hwtimer statistics with #if ENABLE_STATS
- Assembler optimized functions for CNR handling
- Correct off-by-1 after counter reset
- Defer CMR update from hwtimer_unset until ISR fires
- Set the proper prescaler value depending on requested frequency
- Return the actual achieved frequency in pwm_init
- Handle 1-8 channels depending on periph_conf.h instead of 4 fixed
- Perform function argument verification before touching the hardware
- Turn on PORT clock gate before touching PORT registers
- Eliminate some magic numbers