Now, ADC is available on stm32l0 family. A calibration is
done at each new adc_sample. Moreover, when conversion is done,
VREFINT and temperature sensor are dactivated to save power.
Signed-off-by: Aurelien Fillau <aurelien.fillau@gmail.com>
A dispatcher function is implemented for directing writes to the correct
function. The dispatcher is bypassed completely if the CPU only contain
one kind of UART module.
There are at least two different UART hardware modules deployed in
different Kinetis CPU families (or possibly three or more when counting
variations of the UART module). The UART module is an older 8 bit module
with advanced functionality, while the LPUART is a 32 bit module with
focus on low power consumption.
- The older families in the K series all have UART modules.
- The K22F family have both UART and LPUART modules in the same CPU.
- Older L series (e.g. KL25Z) have two variations of the UART module
- Newer L series (e.g. KL43Z) have LPUART modules, and sometimes
UART as well.
- Newer W series (KW41Z) have only LPUART
According to NXP material, there are no 100 MHz K22F parts in 144 pin
packages, which is the reference manual that this header is supposed to
correspond to.
The header was originally included from Keil uVision Kinetis support
packages. It is possible that this header was only used with
engineering samples of the K22F.
The required space for the hardfault handler is defined by
HARDFAULT_HANDLER_REQUIRED_STACK_SPACE, which is given in bytes,
this length is added to &_sram to find a lower limit on the amount of
stack space that the hard fault handler can work with. The _sram
variable, was mistakenly defined as a uint32_t, which makes &_sram into
a uint32_t*, which through pointer addition, made the required space 4
times as big as it was supposed to. By changing the type of _sram to
uint8_t, the required stack space is correctly computed.
The symptom was that the hardfault handler always reported that the
stack pointer had been corrupted and it was impossible to get any useful
information from the crash text.