After switching to new SPI API there is no need to reserve first dummy
byte in buffer and ignore that in application later on. Instead two
buffers can be specified, which is how it is done already in lis2dh
driver. The problem is that dummy byte is still part of the buffer, but
it clearly should no longer be. As an example we write 0x7 (bits to
enable XYZ axes) into CTRL2 instead of CTRL1 register. When reading
measurements on the other hand we have filled buffer starting from 0,
instead of 1 as the driver code has expected.
Fix driver in all places that use burst transfers by removing first
dummy byte from input/output buffer.
Fixes: 2f7e6b6d42 ("drivers/sensors: Switch lis2dh driver to new SPI
API")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Modifications in 'is_regular_addr_valid()' function which didn't work
properly when flash base address was different than 0x00000000.
Added calculating address bounds with respect to flash base address.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
All sensors were using legacy log module registeration method
where LOG_LEVEL was defined before registeration. This method
was error prone as it requires preserving includes order.
Replaced with LOG_MODULE_REGISTER(foo, level).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Currently both uart_stm32_irq_tx_complete() and
uart_stm32_irq_tx_ready() return the TXE flag. However
uart_irq_tx_complete() should really return the TC flag to output true
"Transmit Complete" status.
Signed-off-by: Tommy Vestermark <tovsurf@vestermark.dk>
PPI allocation and freeing was not handled correctly. Additionally,
RTC event was not enabled when PPI was enabled which resulted in
lack of RTC counter clearing.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Implemented latest extensions to the counter API related to
detection of alarms being set too late and short relative alarms.
Implementation could not be realized on nrfx_rtc driver thus
driver has been reimplemented based on nrf_rtc hal.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Implemented latest extensions to the counter API related to
detection of alarms being set too late and short relative alarms.
Implementation could not be realized on nrfx_timer driver thus
driver has been reimplemented based on nrf_timer hal.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The driver fails to compile when CONFIG_UART_INTERRUPT_DRIVEN=n. This is
due to a nested ifdef on CONFIG_UART_INTERRUPT_DRIVEN that is excluding
pieces of code unrelated to the uart interrupts management.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The PL011 driver is not specific to the cortex_m arch and the driver
does not really use anything from the cmsis header file. Remove it.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Fixes u32_t overflow during intermediary calculations using u64_t for
it. on_off is temporary value used for calculating on and off and it
got overflowed with simple test in tests/drivers/pwm/pwm_api
([period]: 2000, [pulse]: 2000)
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When SMP is enabled, the kernel expects that interrupts be delivered
to all CPUs in the system. Change the I/O APIC RTEs accordingly.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
In the general case, the local APIC can't be treated as a normal device
with a single boot-time initialization - on SMP systems, each CPU must
initialize its own. Hence the initialization proper is separated from
the device-driver initialization, and said initialization is called
from the early startup-assembly code when appropriate.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Fix CAN loopback mode in the NXP MCUX FlexCAN driver by only disabling
self-reception when loopback mode was not requested.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This option determines the name under which the device represented by
the `sw_pwm` node is registered in the system. But when the value of
this option does not match the `label` property of the `sw_pwm` node,
a problem arises when the `sw_pwm` node is referenced by a "pwm-leds"
compatible node, since the `*_PWMS_CONTROLLER` macro that is generated
for this referencing node contains a non-existing device name (as it is
the `label` property value, not the Kconfig option value).
This commit solves the issue described above by removing the Kconfig
option and replacing all of its occurrences in sample applications
by the standard macro generated for the `sw_pwm` node, containing
the value of the `label` property of this node.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Reimplementation of clock control driver for nrf platform. It includes
latest API changes: asynchronous starting and getting clock status.
Additionally, it implements calibration algorithm which optionally
skips calibration based on no temperature change. Internal temperature
sensor is used for that.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This patch re-namespaces global variables and functions
that are used only within the arch/arm/ code to be
prefixed with z_arm_.
Some instances of CamelCase have been corrected.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Looking at the code, this flag was probably made 'required: true' by
mistake. Combining 'type: boolean' with 'required: true' for 'ppi-wrap'
means that all nodes that use this binding are required to have a
'ppi-wrap;' property.
The mistake was hidden by a bug in edtlib (failing to flag missing
'required: true' booleans).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix an inline comment in nrf_rtc_timer.c correcting the
path to the mentioned test.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The base_address in the device configuration is used as a handle
to access an entity in memory. In C, we call that a 'pointer'.
Also in C, (versus, say, PL/M) we name these pointer things after
what they point not ('regs') not what they are ('base address').
Thus, we change the member to a pointer type and change its name.
This makes it compile cleanly regardless of machine pointer size,
while also cutting down on a bunch of casting noise.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>